Class: BestbuyApi::Model
- Inherits:
-
Object
- Object
- BestbuyApi::Model
- Defined in:
- lib/bestbuy_api/model.rb
Class Method Summary collapse
- .attribute(id, columns = { search: false, read: true }) ⇒ Object
- .attributes ⇒ Object
- .limit(args) ⇒ Object
- .page(args) ⇒ Object
- .path(path = nil) ⇒ Object
- .select(*args) ⇒ Object
- .where(args) ⇒ Object
Class Method Details
.attribute(id, columns = { search: false, read: true }) ⇒ Object
13 14 15 16 17 |
# File 'lib/bestbuy_api/model.rb', line 13 def self.attribute(id, columns = { search: false, read: true }) row = { id => columns } attributes[:read].merge!(row) unless columns[:read] == false attributes[:search].merge!(row) unless columns[:search] == false end |
.attributes ⇒ Object
5 6 7 |
# File 'lib/bestbuy_api/model.rb', line 5 def self.attributes @attributes ||= { path: nil, read: {}, search: {} } end |
.limit(args) ⇒ Object
27 28 29 |
# File 'lib/bestbuy_api/model.rb', line 27 def self.limit(args) Criteria.new(self).limit(args) end |
.page(args) ⇒ Object
31 32 33 |
# File 'lib/bestbuy_api/model.rb', line 31 def self.page(args) Criteria.new(self).page(args) end |
.path(path = nil) ⇒ Object
9 10 11 |
# File 'lib/bestbuy_api/model.rb', line 9 def self.path(path = nil) attributes[:path] = path end |