Class: Neoon::Model::Config
- Inherits:
-
Object
- Object
- Neoon::Model::Config
- Defined in:
- lib/neoon/model/config.rb
Instance Method Summary collapse
-
#initialize(klass) ⇒ Config
constructor
A new instance of Config.
- #properties ⇒ Object
- #property(name, *opts, &block) ⇒ Object
Constructor Details
#initialize(klass) ⇒ Config
Returns a new instance of Config.
5 6 7 |
# File 'lib/neoon/model/config.rb', line 5 def initialize(klass) @klass = klass end |
Instance Method Details
#properties ⇒ Object
9 10 11 |
# File 'lib/neoon/model/config.rb', line 9 def properties @properties ||= {} end |
#property(name, *opts, &block) ⇒ Object
13 14 15 |
# File 'lib/neoon/model/config.rb', line 13 def property(name, *opts, &block) self.properties[name] = {:block => block}.merge(opts.first || {}).reject { |k, v| v.nil? } end |