Class: Query
Constant Summary collapse
- ATTRIBUTE_AND_VALUE_DIVIDERS =
/(?<!~)=/.freeze
- VALUE_TO_LIST_DIVIDERS =
/(?<!~)&/.freeze
- RepeatedFilter =
Class.new(StandardError)
- Group =
Class.new
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(argv) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(argv) ⇒ Query
Returns a new instance of Query.
16 17 18 |
# File 'lib/query.rb', line 16 def initialize(argv) @argv = argv end |
Instance Attribute Details
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
14 15 16 |
# File 'lib/query.rb', line 14 def argv @argv end |
Instance Method Details
#build ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/query.rb', line 20 def build @build ||= argv.map.with_object([]) do |argument, | query_element = query_element(argument) if .find { |el| el[:attribute] == query_element[:attribute] } repeated_filter(query_element[:attribute]) end << query_element end end |