Class: Hecks::Adapters::SQLDatabase::Commands::Read
- Inherits:
-
Object
- Object
- Hecks::Adapters::SQLDatabase::Commands::Read
- Defined in:
- lib/commands/read.rb,
lib/commands/read/fetch_references.rb
Defined Under Namespace
Classes: FetchReferences
Instance Attribute Summary collapse
-
#entity ⇒ Object
readonly
Returns the value of attribute entity.
-
#head ⇒ Object
readonly
Returns the value of attribute head.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(id:, head:, entity_class:) ⇒ Read
constructor
A new instance of Read.
Constructor Details
Instance Attribute Details
#entity ⇒ Object (readonly)
Returns the value of attribute entity.
7 8 9 |
# File 'lib/commands/read.rb', line 7 def entity @entity end |
#head ⇒ Object (readonly)
Returns the value of attribute head.
7 8 9 |
# File 'lib/commands/read.rb', line 7 def head @head end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/commands/read.rb', line 7 def id @id end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
7 8 9 |
# File 'lib/commands/read.rb', line 7 def table @table end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/commands/read.rb', line 16 def call fetch_entity return if @entity.nil? @entity_class.new( @entity.merge(FetchReferences.new(self).call.reference_map) ) end |