Class: Hecks::Domain::Adapters::SQLDatabase::Commands::Read::FetchReferences

Inherits:
Object
  • Object
show all
Defined in:
lib/adapters/sql_database/commands/read/fetch_references.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(read_command) ⇒ FetchReferences

Returns a new instance of FetchReferences.



9
10
11
12
13
14
15
# File 'lib/adapters/sql_database/commands/read/fetch_references.rb', line 9

def initialize(read_command)
  @head = read_command.head
  @reference_map = {}
  @entity = read_command.entity
  @table = read_command.table
  @id = read_command.id
end

Instance Attribute Details

#reference_mapObject (readonly)

Returns the value of attribute reference_map.



8
9
10
# File 'lib/adapters/sql_database/commands/read/fetch_references.rb', line 8

def reference_map
  @reference_map
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
# File 'lib/adapters/sql_database/commands/read/fetch_references.rb', line 17

def call
  @head.references.each do |reference|
    fetch_reference(reference)
    fetch_references(reference)
  end
  self
end