Class: Mastar::Configuration
- Inherits:
-
Object
- Object
- Mastar::Configuration
- Defined in:
- lib/mastar/configuration.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #key(key = nil) ⇒ Object
- #name(name = nil) ⇒ Object
- #value(value = nil) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Configuration
Returns a new instance of Configuration.
4 5 6 7 8 9 10 |
# File 'lib/mastar/configuration.rb', line 4 def initialize( = {}) opts = .is_a?(Hash) ? : {} [:name, :value, :key].each do |k| v = opts[k] || opts[k.to_s] __send__(k, v.to_sym) if v end end |
Instance Method Details
#key(key = nil) ⇒ Object
22 23 24 25 |
# File 'lib/mastar/configuration.rb', line 22 def key(key = nil) @key = key if key @key end |
#name(name = nil) ⇒ Object
12 13 14 15 |
# File 'lib/mastar/configuration.rb', line 12 def name(name = nil) @name = name if name @name || :name end |
#value(value = nil) ⇒ Object
17 18 19 20 |
# File 'lib/mastar/configuration.rb', line 17 def value(value = nil) @value = value if value @value || :id end |