Class: SyntaxTree::Database::QueryResult
- Inherits:
-
Object
- Object
- SyntaxTree::Database::QueryResult
- Defined in:
- lib/syntax_tree/database.rb
Overview
A lazy query result.
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(database, query) ⇒ QueryResult
constructor
A new instance of QueryResult.
Constructor Details
#initialize(database, query) ⇒ QueryResult
Returns a new instance of QueryResult.
154 155 156 157 |
# File 'lib/syntax_tree/database.rb', line 154 def initialize(database, query) @database = database @query = query end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
152 153 154 |
# File 'lib/syntax_tree/database.rb', line 152 def database @database end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
152 153 154 |
# File 'lib/syntax_tree/database.rb', line 152 def query @query end |
Instance Method Details
#each(&block) ⇒ Object
159 160 161 162 |
# File 'lib/syntax_tree/database.rb', line 159 def each(&block) return enum_for(__method__) unless block_given? query.each(database, &block) end |