Class: Get::EntityFactory
- Inherits:
-
Object
- Object
- Get::EntityFactory
- Defined in:
- lib/get/entity_factory.rb
Instance Method Summary collapse
- #build(adapter_result) ⇒ Object
-
#initialize(entity, query_class_name, is_collection, result_key) ⇒ EntityFactory
constructor
A new instance of EntityFactory.
Constructor Details
#initialize(entity, query_class_name, is_collection, result_key) ⇒ EntityFactory
Returns a new instance of EntityFactory.
3 4 5 |
# File 'lib/get/entity_factory.rb', line 3 def initialize(entity, query_class_name, is_collection, result_key) @entity, @query_class_name, @is_collection, @result_key = entity, query_class_name, is_collection, result_key end |
Instance Method Details
#build(adapter_result) ⇒ Object
7 8 9 10 |
# File 'lib/get/entity_factory.rb', line 7 def build(adapter_result) raise ::Get::Errors::RecordNotFound.new unless adapter_result.context klass.new(db_result(adapter_result)) end |