Class: Magentwo::Filter::Simple
- Inherits:
-
Object
- Object
- Magentwo::Filter::Simple
- Defined in:
- lib/filter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ Simple
constructor
A new instance of Simple.
- #to_query(idx = nil) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(key, value) ⇒ Simple
Returns a new instance of Simple.
39 40 41 42 |
# File 'lib/filter.rb', line 39 def initialize key, value @key = key @value = value end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
38 39 40 |
# File 'lib/filter.rb', line 38 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
38 39 40 |
# File 'lib/filter.rb', line 38 def value @value end |
Instance Method Details
#to_query(idx = nil) ⇒ Object
44 45 46 |
# File 'lib/filter.rb', line 44 def to_query idx=nil "searchCriteria[#{key}]=#{value}" end |
#to_s ⇒ Object
48 49 50 |
# File 'lib/filter.rb', line 48 def to_s "#{self.key} == #{self.value}" end |