Module: Horza::Adapters::ClassMethods
- Included in:
- AbstractAdapter
- Defined in:
- lib/horza/adapters/class_methods.rb
Instance Method Summary collapse
- #collection_entity_klass ⇒ Object
- #context_for_entity(entity) ⇒ Object
- #expected_errors ⇒ Object
- #expected_horza_errors ⇒ Object
- #horza_error_from_orm_error(orm_error) ⇒ Object
- #not_implemented_error ⇒ Object
- #single_entity_klass ⇒ Object
Instance Method Details
#collection_entity_klass ⇒ Object
28 29 30 |
# File 'lib/horza/adapters/class_methods.rb', line 28 def collection_entity_klass ::Horza::Entities::Collection end |
#context_for_entity(entity) ⇒ Object
16 17 18 |
# File 'lib/horza/adapters/class_methods.rb', line 16 def context_for_entity(entity) DependencyLoading.resolve_dependency(entity.to_s) end |
#expected_errors ⇒ Object
8 9 10 |
# File 'lib/horza/adapters/class_methods.rb', line 8 def expected_errors expected_errors_map.keys end |
#expected_horza_errors ⇒ Object
4 5 6 |
# File 'lib/horza/adapters/class_methods.rb', line 4 def expected_horza_errors [Horza::Errors::RecordNotFound, Horza::Errors::RecordInvalid] end |
#horza_error_from_orm_error(orm_error) ⇒ Object
12 13 14 |
# File 'lib/horza/adapters/class_methods.rb', line 12 def horza_error_from_orm_error(orm_error) expected_errors_map[orm_error] end |
#not_implemented_error ⇒ Object
20 21 22 |
# File 'lib/horza/adapters/class_methods.rb', line 20 def not_implemented_error raise ::Horza::Errors::MethodNotImplemented, 'You must implement this method in your adapter.' end |
#single_entity_klass ⇒ Object
24 25 26 |
# File 'lib/horza/adapters/class_methods.rb', line 24 def single_entity_klass ::Horza::Entities::Single end |