Class: Magentwo::Filter::Fields
- Inherits:
-
Object
- Object
- Magentwo::Filter::Fields
- Defined in:
- lib/filter.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
Instance Method Summary collapse
-
#initialize(fields) ⇒ Fields
constructor
A new instance of Fields.
- #to_query(idx = nil) ⇒ Object
Constructor Details
#initialize(fields) ⇒ Fields
Returns a new instance of Fields.
139 140 141 |
# File 'lib/filter.rb', line 139 def initialize fields @fields = fields end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
138 139 140 |
# File 'lib/filter.rb', line 138 def fields @fields end |
Instance Method Details
#to_query(idx = nil) ⇒ Object
142 143 144 145 |
# File 'lib/filter.rb', line 142 def to_query idx=nil #TODO api supports nested field selection e.g. items[address[street]] "fields=items[#{CGI.escape(self.fields.map(&:to_s).join(","))}]" end |