Class: Rafflesia::DatabaseJoinFragment

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/database_join_measurements/database_join_fragment.rb

Constant Summary collapse

HASH_ATTRS =
{
  sources: :sources,
  sql_from_clause: :sql_from_clause,
  sql_join_clause: :sql_join_clause
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ DatabaseJoinFragment

Returns a new instance of DatabaseJoinFragment.



19
20
21
22
23
24
25
# File 'lib/rafflesia/database_join_measurements/database_join_fragment.rb', line 19

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @sources = (hash[:sources] || []).map { |item| item ? Rafflesia::DatabaseJoinSourceFragment.new(item) : nil }
  @sql_from_clause = hash[:sql_from_clause]
  @sql_join_clause = hash[:sql_join_clause]
end

Instance Attribute Details

#sourcesObject

Returns the value of attribute sources.



14
15
16
# File 'lib/rafflesia/database_join_measurements/database_join_fragment.rb', line 14

def sources
  @sources
end

#sql_from_clauseObject

Returns the value of attribute sql_from_clause.



14
15
16
# File 'lib/rafflesia/database_join_measurements/database_join_fragment.rb', line 14

def sql_from_clause
  @sql_from_clause
end

#sql_join_clauseObject

Returns the value of attribute sql_join_clause.



14
15
16
# File 'lib/rafflesia/database_join_measurements/database_join_fragment.rb', line 14

def sql_join_clause
  @sql_join_clause
end