Module: Horza::Entities
- Defined in:
- lib/horza/entities.rb,
lib/horza/entities/single.rb,
lib/horza/entities/collection.rb,
lib/horza/entities/single_with_active_model.rb
Defined Under Namespace
Classes: Collection, Single, SingleWithActiveModel
Class Method Summary
collapse
Class Method Details
.collection_entities ⇒ Object
.collection_entity_for(entity_symbol, attributes) ⇒ Object
13
14
15
16
|
# File 'lib/horza/entities.rb', line 13
def collection_entity_for(entity_symbol, attributes)
klass = collection_entities[entity_symbol] || Horza.adapter.collection_entity_klass
klass.new(attributes)
end
|
.single_entities ⇒ Object
.single_entity_for(entity_symbol, attributes) ⇒ Object
4
5
6
7
|
# File 'lib/horza/entities.rb', line 4
def single_entity_for(entity_symbol, attributes)
klass = single_entities[entity_symbol] || Horza.adapter.single_entity_klass
klass.new(attributes)
end
|