Class: Apress::Moysklad::Presenters::Assortment
- Inherits:
-
Object
- Object
- Apress::Moysklad::Presenters::Assortment
- Defined in:
- lib/apress/moysklad/presenters/assortment.rb
Overview
Презентер для объектов типа - Ассортимент в МойСклад
Constant Summary collapse
- ATTRIBUTES =
[ :id, :code, :accountId, :externalCode, :article, :name, :description, :minPrice, :pathName, :version, :stock, :reserve, :inTransit, :quantity, :archived, :updated, :modificationsCount, :weight, :volume, :vat, :effectiveVat, meta: [:type].freeze, image: [:title, :filename, :size, :updated, meta: [:href, :mediaType].freeze].freeze, buyPrice: [:value].freeze, salePrices: [:value, :priceType].freeze ].freeze
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #expose(row) ⇒ Object
-
#initialize(client) ⇒ Assortment
constructor
A new instance of Assortment.
Constructor Details
#initialize(client) ⇒ Assortment
Returns a new instance of Assortment.
51 52 53 54 |
# File 'lib/apress/moysklad/presenters/assortment.rb', line 51 def initialize(client) @client = client @counter = 0 end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
49 50 51 |
# File 'lib/apress/moysklad/presenters/assortment.rb', line 49 def client @client end |
Instance Method Details
#expose(row) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/apress/moysklad/presenters/assortment.rb', line 56 def expose(row) record = { __line__: @counter += 1, __column__: 1 } record.merge! filter(row) auth_to_link! record[:image][:meta][:href] if record.key? :image record end |