Class: Apress::YandexMarket::Presenters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/apress/yandex_market/presenters/base.rb

Direct Known Subclasses

Model

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



11
12
13
# File 'lib/apress/yandex_market/presenters/base.rb', line 11

def initialize
  @counter = 0
end

Class Attribute Details

.attributesObject

Returns the value of attribute attributes.



6
7
8
# File 'lib/apress/yandex_market/presenters/base.rb', line 6

def attributes
  @attributes
end

Instance Method Details

#expose(row) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/apress/yandex_market/presenters/base.rb', line 15

def expose(row)
  record = {
    __line__: @counter += 1,
    __column__: 1
  }

  record.merge! filter(row)

  record
end