Class: Magentwo::Filter::Simple

Inherits:
Object
  • Object
show all
Defined in:
lib/filter.rb

Direct Known Subclasses

CurrentPage, PageSize

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject

Returns the value of attribute key.



38
39
40
# File 'lib/filter.rb', line 38

def key
  @key
end

#valueObject

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_sObject



48
49
50
# File 'lib/filter.rb', line 48

def to_s
  "#{self.key} == #{self.value}"
end