Class: Editables::FieldsCollection
- Inherits:
-
Object
- Object
- Editables::FieldsCollection
- Defined in:
- lib/editables/fields_collection.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(editables_config) ⇒ FieldsCollection
constructor
A new instance of FieldsCollection.
Constructor Details
#initialize(editables_config) ⇒ FieldsCollection
Returns a new instance of FieldsCollection.
4 5 6 |
# File 'lib/editables/fields_collection.rb', line 4 def initialize(editables_config) @collection = to_hash(editables_config) end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
3 4 5 |
# File 'lib/editables/fields_collection.rb', line 3 def collection @collection end |
Instance Method Details
#[](key) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/editables/fields_collection.rb', line 8 def [](key) begin collection.fetch(key) rescue collection.fetch("editables/field").fetch(key) end end |