Class: Magentwo::Filter::Multi
- Inherits:
-
Object
- Object
- Magentwo::Filter::Multi
- Defined in:
- lib/filter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#kvps ⇒ Object
Returns the value of attribute kvps.
Instance Method Summary collapse
-
#initialize(kvps) ⇒ Multi
constructor
A new instance of Multi.
- #to_query(idx = nil) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(kvps) ⇒ Multi
Returns a new instance of Multi.
55 56 57 |
# File 'lib/filter.rb', line 55 def initialize kvps @kvps = kvps end |
Instance Attribute Details
#kvps ⇒ Object
Returns the value of attribute kvps.
54 55 56 |
# File 'lib/filter.rb', line 54 def kvps @kvps end |
Instance Method Details
#to_query(idx = nil) ⇒ Object
59 60 61 62 63 |
# File 'lib/filter.rb', line 59 def to_query idx=nil kvps.map do |kvp| "searchCriteria[#{kvp[:key]}]=#{kvp[:value]}" end.join("&") end |
#to_s ⇒ Object
65 66 67 68 69 |
# File 'lib/filter.rb', line 65 def to_s self.kvps.map do |kvp| "#{kvp[:key]} = #{kvp[:value]}" end.join("\n") end |