Class: Rafflesia::QueryData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::QueryData
- Defined in:
- lib/rafflesia/query/query_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ columns: :columns, dialect: :dialect, engine: :engine, has_more: :has_more, id: :id, measurements: :measurements, next_cursor: :next_cursor, object: :object, ontology_digest: :ontology_digest, ontology_version: :ontology_version, query_digest: :query_digest, row_count: :row_count, rows: :rows, sources: :sources, sql: :sql, verified_join_approvals: :verified_join_approvals, verified_join_evidence: :verified_join_evidence }.freeze
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#dialect ⇒ Object
Returns the value of attribute dialect.
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#has_more ⇒ Object
Returns the value of attribute has_more.
-
#id ⇒ Object
Returns the value of attribute id.
-
#measurements ⇒ Object
Returns the value of attribute measurements.
-
#next_cursor ⇒ Object
Returns the value of attribute next_cursor.
-
#object ⇒ Object
Returns the value of attribute object.
-
#ontology_digest ⇒ Object
Returns the value of attribute ontology_digest.
-
#ontology_version ⇒ Object
Returns the value of attribute ontology_version.
-
#query_digest ⇒ Object
Returns the value of attribute query_digest.
-
#row_count ⇒ Object
Returns the value of attribute row_count.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#sources ⇒ Object
Returns the value of attribute sources.
-
#sql ⇒ Object
Returns the value of attribute sql.
-
#verified_join_approvals ⇒ Object
Returns the value of attribute verified_join_approvals.
-
#verified_join_evidence ⇒ Object
Returns the value of attribute verified_join_evidence.
Instance Method Summary collapse
-
#initialize(json) ⇒ QueryData
constructor
A new instance of QueryData.
Constructor Details
#initialize(json) ⇒ QueryData
Returns a new instance of QueryData.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rafflesia/query/query_data.rb', line 47 def initialize(json) super() hash = self.class.normalize(json) @columns = (hash[:columns] || []).map { |item| item ? Rafflesia::TableColumn.new(item) : nil } @dialect = hash[:dialect] @engine = hash[:engine] @has_more = hash[:has_more] @id = hash[:id] @measurements = hash[:measurements] ? Rafflesia::QueryMeasurements.new(hash[:measurements]) : nil @next_cursor = hash[:next_cursor] @object = hash[:object] @ontology_digest = hash[:ontology_digest] @ontology_version = hash[:ontology_version] @query_digest = hash[:query_digest] @row_count = hash[:row_count] @rows = (hash[:rows] || []).map { |item| item || {} } @sources = (hash[:sources] || []).map { |item| item ? Rafflesia::ResolvedQuerySource.new(item) : nil } @sql = hash[:sql] @verified_join_approvals = (hash[:verified_join_approvals] || []).map { |item| item ? Rafflesia::VerifiedRegistryJoinApproval.new(item) : nil } @verified_join_evidence = (hash[:verified_join_evidence] || []).map { |item| item ? Rafflesia::VerifiedDatabaseJoinEvidence.new(item) : nil } end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def columns @columns end |
#dialect ⇒ Object
Returns the value of attribute dialect.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def dialect @dialect end |
#engine ⇒ Object
Returns the value of attribute engine.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def engine @engine end |
#has_more ⇒ Object
Returns the value of attribute has_more.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def has_more @has_more end |
#id ⇒ Object
Returns the value of attribute id.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def id @id end |
#measurements ⇒ Object
Returns the value of attribute measurements.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def measurements @measurements end |
#next_cursor ⇒ Object
Returns the value of attribute next_cursor.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def next_cursor @next_cursor end |
#object ⇒ Object
Returns the value of attribute object.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def object @object end |
#ontology_digest ⇒ Object
Returns the value of attribute ontology_digest.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def ontology_digest @ontology_digest end |
#ontology_version ⇒ Object
Returns the value of attribute ontology_version.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def ontology_version @ontology_version end |
#query_digest ⇒ Object
Returns the value of attribute query_digest.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def query_digest @query_digest end |
#row_count ⇒ Object
Returns the value of attribute row_count.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def row_count @row_count end |
#rows ⇒ Object
Returns the value of attribute rows.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def rows @rows end |
#sources ⇒ Object
Returns the value of attribute sources.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def sources @sources end |
#sql ⇒ Object
Returns the value of attribute sql.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def sql @sql end |
#verified_join_approvals ⇒ Object
Returns the value of attribute verified_join_approvals.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def verified_join_approvals @verified_join_approvals end |
#verified_join_evidence ⇒ Object
Returns the value of attribute verified_join_evidence.
28 29 30 |
# File 'lib/rafflesia/query/query_data.rb', line 28 def verified_join_evidence @verified_join_evidence end |