Class: RecordStore::Zone::Config::IgnorePattern
- Inherits:
-
Object
- Object
- RecordStore::Zone::Config::IgnorePattern
- Defined in:
- lib/record_store/zone/config/ignore_pattern.rb
Constant Summary collapse
- MATCH_TYPE_FIELD =
'match'- MATCH_TYPE_REGEX =
'regex'- MATCH_TYPE_EXACT =
'exact'
Instance Method Summary collapse
- #ignore?(record) ⇒ Boolean
-
#initialize(orig_hash) ⇒ IgnorePattern
constructor
A new instance of IgnorePattern.
- #to_hash ⇒ Object
Constructor Details
#initialize(orig_hash) ⇒ IgnorePattern
Returns a new instance of IgnorePattern.
11 12 13 |
# File 'lib/record_store/zone/config/ignore_pattern.rb', line 11 def initialize(orig_hash) @orig_hash = orig_hash end |
Instance Method Details
#ignore?(record) ⇒ Boolean
15 16 17 18 19 |
# File 'lib/record_store/zone/config/ignore_pattern.rb', line 15 def ignore?(record) all_pairs.all? do |(key, value)| record.respond_to?(key) && value_matches?(value, record.send(key)) end end |
#to_hash ⇒ Object
21 22 23 |
# File 'lib/record_store/zone/config/ignore_pattern.rb', line 21 def to_hash @orig_hash end |