Class: LocalizableModel::Configuration
- Inherits:
-
Object
- Object
- LocalizableModel::Configuration
- Defined in:
- lib/localizable_model/configuration.rb
Instance Method Summary collapse
- #attribute(attribute_name, options = {}) ⇒ Object
- #attribute?(attribute) ⇒ Boolean
- #attributes ⇒ Object
- #dictionary(dict) ⇒ Object
-
#initialize(attributes = nil) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(attributes = nil) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/localizable_model/configuration.rb', line 5 def initialize(attributes = nil) @attributes = attributes end |
Instance Method Details
#attribute(attribute_name, options = {}) ⇒ Object
9 10 11 |
# File 'lib/localizable_model/configuration.rb', line 9 def attribute(attribute_name, = {}) attribute_table[attribute_name.to_sym] = end |
#attribute?(attribute) ⇒ Boolean
21 22 23 |
# File 'lib/localizable_model/configuration.rb', line 21 def attribute?(attribute) attributes.keys.include?(attribute) end |
#attributes ⇒ Object
13 14 15 |
# File 'lib/localizable_model/configuration.rb', line 13 def attributes attribute_table.merge(dictionary_attributes) end |
#dictionary(dict) ⇒ Object
17 18 19 |
# File 'lib/localizable_model/configuration.rb', line 17 def dictionary(dict) dictionaries << dict end |