Class: ROM::DynamoDB::Dataset::WhereClause
- Inherits:
-
Object
- Object
- ROM::DynamoDB::Dataset::WhereClause
- Defined in:
- lib/rom/dynamodb/dataset/where_clause.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#clauses ⇒ Object
readonly
Returns the value of attribute clauses.
-
#maps ⇒ Object
readonly
Returns the value of attribute maps.
Instance Method Summary collapse
- #execute(&block) ⇒ Object
-
#initialize(maps = {}) ⇒ WhereClause
constructor
A new instance of WhereClause.
- #method_missing(key) ⇒ Object
Constructor Details
#initialize(maps = {}) ⇒ WhereClause
Returns a new instance of WhereClause.
84 85 86 87 |
# File 'lib/rom/dynamodb/dataset/where_clause.rb', line 84 def initialize(maps = {}) @clauses = Clause.new @maps = maps end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key) ⇒ Object
94 95 96 |
# File 'lib/rom/dynamodb/dataset/where_clause.rb', line 94 def method_missing(key) Operand.new(key: key, val: maps[key]) end |
Instance Attribute Details
#clauses ⇒ Object (readonly)
Returns the value of attribute clauses.
82 83 84 |
# File 'lib/rom/dynamodb/dataset/where_clause.rb', line 82 def clauses @clauses end |
#maps ⇒ Object (readonly)
Returns the value of attribute maps.
82 83 84 |
# File 'lib/rom/dynamodb/dataset/where_clause.rb', line 82 def maps @maps end |
Instance Method Details
#execute(&block) ⇒ Object
89 90 91 92 |
# File 'lib/rom/dynamodb/dataset/where_clause.rb', line 89 def execute(&block) @clauses.concat(instance_exec(&block)) self end |