Class: Rafflesia::DatabaseJoinFragment
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::DatabaseJoinFragment
- 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
-
#sources ⇒ Object
Returns the value of attribute sources.
-
#sql_from_clause ⇒ Object
Returns the value of attribute sql_from_clause.
-
#sql_join_clause ⇒ Object
Returns the value of attribute sql_join_clause.
Instance Method Summary collapse
-
#initialize(json) ⇒ DatabaseJoinFragment
constructor
A new instance of DatabaseJoinFragment.
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
#sources ⇒ Object
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_clause ⇒ Object
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_clause ⇒ Object
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 |