Class: TransactionQL::Match
- Inherits:
-
Expression
- Object
- Expression
- TransactionQL::Match
- Defined in:
- lib/transaction_ql/expressions.rb
Instance Method Summary collapse
-
#initialize(column, regexp) ⇒ Match
constructor
A new instance of Match.
- #matches?(hash) ⇒ Boolean
Constructor Details
#initialize(column, regexp) ⇒ Match
Returns a new instance of Match.
65 66 67 68 |
# File 'lib/transaction_ql/expressions.rb', line 65 def initialize(column, regexp) @column = column @regexp = regexp end |
Instance Method Details
#matches?(hash) ⇒ Boolean
70 71 72 73 |
# File 'lib/transaction_ql/expressions.rb', line 70 def matches?(hash) match = @regexp.match hash.fetch(@column) return !match.nil? end |