Module: Horza::Adapters::ClassMethods

Included in:
AbstractAdapter
Defined in:
lib/horza/adapters/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#collection_entity_klassObject



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_errorsObject



8
9
10
# File 'lib/horza/adapters/class_methods.rb', line 8

def expected_errors
  expected_errors_map.keys
end

#expected_horza_errorsObject



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_errorObject



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_klassObject



24
25
26
# File 'lib/horza/adapters/class_methods.rb', line 24

def single_entity_klass
  ::Horza::Entities::Single
end