Class Waves::Configurations::Base
In: lib/runtime/configuration.rb
Parent: Object

Methods

[]   []=   attribute   attributes  

Public Class methods

Get the value of the given attribute. Typically, you wouldn‘t use this directly.

[Source]

    # File lib/runtime/configuration.rb, line 14
14:       def self.[]( name ) ; send "_#{name}" ; end

Set the given attribute with the given value. Typically, you wouldn‘t use this directly.

[Source]

    # File lib/runtime/configuration.rb, line 8
 8:       def self.[]=( name, val )
 9:         meta_def("_#{name}") { val }
10:       end

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

[Source]

    # File lib/runtime/configuration.rb, line 18
18:       def self.attribute( name )
19:         meta_def(name) do |*args|
20:           raise ArgumentError.new('Too many arguments.') if args.length > 1
21:           args.length == 1 ? self[ name ] = args.first : self[ name ]
22:         end
23:         self[ name ] = nil
24:       end

[Source]

    # File lib/runtime/configuration.rb, line 26
26:       def self.attributes( *names )
27:         names.each { |name| attribute( name ) }
28:       end

[Validate]