Module: Tamashii::Configurable::ClassMethods
- Defined in:
- lib/tamashii/configurable.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#config(attr_name, options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/tamashii/configurable.rb', line 8 def config(attr_name, = {}) configs[attr_name.to_sym] = Config::Attribute.new(attr_name, ) define_method(attr_name) { self[attr_name] } define_method("#{attr_name}=") { |value| self[attr_name] = value } end |
#config?(name) ⇒ Boolean
18 19 20 |
# File 'lib/tamashii/configurable.rb', line 18 def config?(name) @configs.keys.include?(name.to_sym) end |
#configs ⇒ Object
14 15 16 |
# File 'lib/tamashii/configurable.rb', line 14 def configs @configs ||= {} end |