Class: CassandraMigrations::Cassandra::QueryResult
- Inherits:
-
Object
- Object
- CassandraMigrations::Cassandra::QueryResult
- Defined in:
- lib/cassandra_migrations/cassandra/query_result.rb
Instance Method Summary collapse
-
#initialize(cql_query_result) ⇒ QueryResult
constructor
A new instance of QueryResult.
-
#inspect ⇒ Object
We don’t want to flood the console or the log with an inspection of a lot of loaded data.
-
#metadata ⇒ Object
Returns => :column_type hash.
-
#method_missing(name, *args, &block) ⇒ Object
Delegates all other method calls to the lower level query result (Cql::Client::QueryResult).
Constructor Details
#initialize(cql_query_result) ⇒ QueryResult
Returns a new instance of QueryResult.
7 8 9 |
# File 'lib/cassandra_migrations/cassandra/query_result.rb', line 7 def initialize(cql_query_result) @cql_query_result = cql_query_result end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
Delegates all other method calls to the lower level query result (Cql::Client::QueryResult)
27 28 29 |
# File 'lib/cassandra_migrations/cassandra/query_result.rb', line 27 def method_missing(name, *args, &block) @cql_query_result.send(name, *args, &block) end |
Instance Method Details
#inspect ⇒ Object
We don’t want to flood the console or the log with an inspection of a lot of loaded data
13 14 15 |
# File 'lib/cassandra_migrations/cassandra/query_result.rb', line 13 def inspect "#<CassandraMigrations::Cassandra::QueryResult:#{object_id}>" end |
#metadata ⇒ Object
Returns => :column_type hash
18 19 20 21 22 23 24 |
# File 'lib/cassandra_migrations/cassandra/query_result.rb', line 18 def hash = {} @cql_query_result..each do || hash[.column_name] = .type end hash end |