From 1400fec62e4e692badc5b68eb7d6d947997d7204 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Fri, 1 Apr 2011 13:10:42 -0700 Subject: MAINT: nicer to_s for actions, for user-focused rendering. This makes it possible for us to just print the Action object directly and get a human-focused output string. Reviewed-By: Pieter van de Bruggen --- lib/puppet/string/action.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/puppet/string/action.rb b/lib/puppet/string/action.rb index 4db9e97e2..5a7f3f203 100644 --- a/lib/puppet/string/action.rb +++ b/lib/puppet/string/action.rb @@ -3,6 +3,10 @@ require 'puppet/string' class Puppet::String::Action attr_reader :name + def to_s + "#{@string}##{@name}" + end + def initialize(string, name, attrs = {}) name = name.to_s raise "'#{name}' is an invalid action name" unless name =~ /^[a-z]\w*$/ -- cgit