Class: Drillbit::Parameters::Filter
- Inherits:
-
Object
- Object
- Drillbit::Parameters::Filter
- Defined in:
- lib/drillbit/parameters/filter.rb
Constant Summary collapse
- NUMERICAL =
/[\d_\.]+?/
- ISO8601 =
/\d{4}-\d{2}-\d{2}T\d{2}\:\d{2}\:\d{2}(?:[+-]\d{2}\:\d{2}|Z)/
- NUMERICAL_RANGE =
/\A(#{NUMERICAL})\.\.\.?(#{NUMERICAL}|Infinity)\z/
- DATE_RANGE =
/\A(#{ISO8601})\.\.\.?(#{ISO8601})\z/
Instance Attribute Summary collapse
-
#raw_parameters ⇒ Object
Returns the value of attribute raw_parameters.
Instance Method Summary collapse
- #each_with_object(memoized) ⇒ Object
-
#initialize(raw_parameters) ⇒ Filter
constructor
A new instance of Filter.
- #present? ⇒ Boolean
Constructor Details
#initialize(raw_parameters) ⇒ Filter
Returns a new instance of Filter.
13 14 15 |
# File 'lib/drillbit/parameters/filter.rb', line 13 def initialize(raw_parameters) self.raw_parameters = raw_parameters || {} end |
Instance Attribute Details
#raw_parameters ⇒ Object
Returns the value of attribute raw_parameters.
11 12 13 |
# File 'lib/drillbit/parameters/filter.rb', line 11 def raw_parameters @raw_parameters end |
Instance Method Details
#each_with_object(memoized) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/drillbit/parameters/filter.rb', line 21 def each_with_object(memoized) compacted_parameters.each do |name, value| memoized = yield name, format_value(value), memoized end memoized end |
#present? ⇒ Boolean
17 18 19 |
# File 'lib/drillbit/parameters/filter.rb', line 17 def present? compacted_parameters.any? end |