Class: Fire::SingleNestedModel
- Inherits:
-
NestedModel
- Object
- OpenStruct
- Model
- NestedModel
- Fire::SingleNestedModel
- Defined in:
- lib/model/nested/single.rb
Defined Under Namespace
Classes: IdKeyNotSupported, PathKeysNotSupported
Constant Summary
Constants inherited from Model
Class Method Summary collapse
- .folder_content(parent) ⇒ Object
- .has_path_keys(*keys) ⇒ Object
- .id_key ⇒ Object
- .set_id_key(value) ⇒ Object
Methods inherited from NestedModel
all, collection_name, folder, in_collection, #initialize, #method_missing, nested_in, #nested_options, own_path_keys, query, #save, #saving_data, #set_id_key, #sync_parent
Methods inherited from Model
#==, all_path_keys, #cache, #collection_name, collection_name, connection, create, #custom_data, #data, #delete, #delete_field, #has_data?, #id_key, #id_value, in_collection, #initialize, next_id, own_path_keys, #path, #path_changed?, #path_data, path_value_param, #path_values, #persisted?, prepare_hash, #reload, #save, #set, take, #update, #update_field
Methods included from NestedParent
Constructor Details
This class inherits a constructor from Fire::NestedModel
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Fire::NestedModel
Class Method Details
.folder_content(parent) ⇒ Object
11 12 13 14 15 |
# File 'lib/model/nested/single.rb', line 11 def folder_content(parent) init_empty_parent_object(parent) parent_original = parent.send(folder) new(parent_original.clone.merge(parent.path_data), parent_original) end |
.has_path_keys(*keys) ⇒ Object
7 8 9 |
# File 'lib/model/nested/single.rb', line 7 def has_path_keys(*keys) raise PathKeysNotSupported.new(self) end |
.id_key ⇒ Object
17 18 19 |
# File 'lib/model/nested/single.rb', line 17 def id_key parent.id_key end |
.set_id_key(value) ⇒ Object
21 22 23 |
# File 'lib/model/nested/single.rb', line 21 def set_id_key(value) raise IdKeyNotSupported.new(self) end |