Method: Waves::Configurations::Base.attribute

Defined in:
lib/runtime/configuration.rb

.attribute(name) ⇒ Object

Define a new attribute. After calling this, you can get and set the value using the attribute name as the method



18
19
20
21
22
23
24
# File 'lib/runtime/configuration.rb', line 18

def self.attribute( name )
  meta_def(name) do |*args|
    raise ArgumentError.new('Too many arguments.') if args.length > 1
    args.length == 1 ? self[ name ] = args.first : self[ name ]
  end
  self[ name ] = nil
end