Class: JSONORM::ChainableQuery
- Inherits:
-
Object
- Object
- JSONORM::ChainableQuery
- Defined in:
- lib/json-orm/chainable-query.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(orm, data) ⇒ ChainableQuery
constructor
A new instance of ChainableQuery.
- #where(attribute, value) ⇒ Object
Constructor Details
#initialize(orm, data) ⇒ ChainableQuery
Returns a new instance of ChainableQuery.
3 4 5 6 |
# File 'lib/json-orm/chainable-query.rb', line 3 def initialize(orm, data) @orm = orm @data = data end |
Instance Method Details
#execute ⇒ Object
13 14 15 |
# File 'lib/json-orm/chainable-query.rb', line 13 def execute @data end |
#where(attribute, value) ⇒ Object
8 9 10 11 |
# File 'lib/json-orm/chainable-query.rb', line 8 def where(attribute, value) @data = @data.select { |record| record[attribute].to_s == value.to_s } self end |