lib/chef-workflow/support/attr.rb
#
# Defines an attribute that is both a standard writer, but with an overloaded
# reader that accepts an optional argument. Equivalent to this code for `foo`:
#
#     attr_writer :foo
#
#     def foo(arg=nil)
#       if arg
#         @foo = arg
#       end
#
#       @foo
#     end
#
Defines an attribute that is both a standard writer, but with an overloaded
reader that accepts an optional argument. Equivalent to this code for `foo`.





@foo
end
Defines an attribute that is both a standard writer but with an overloaded reader that accepts an optional argument . Equivalent to this code for ` foo ` . @foo end
def fancy_attr(name)
    class_eval <<-EOF
      attr_writer :#{name}
      def #{name}(arg=nil)
        if arg
          @#{name} = arg
        end
        @#{name}
      end
    EOF
  end
def fancy_attr ( name ) class_eval <<-EOF 
      attr_writer : #{ name } 
      def  #{ name } (arg=nil)
        if arg
          @ #{ name }  = arg
        end

        @ #{ name } 
      end
     EOF end
Defines an attribute that is both a standard writer, but with an overloaded
reader that accepts an optional argument.
Defines an attribute that is both a standard writer but with an overloaded reader that accepts an optional argument .
name
<not_specific>