Class: Amazon::SalesRankMetrics::Row

Inherits:
Data
  • Object
show all
Defined in:
app/services/amazon/sales_rank_metrics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(catalog_item_id: nil, item_id: nil, sku: nil, asin: nil, amazon_url: nil, category_kind: nil, category_id: nil, category_name: nil, current_rank: nil, observed_on: nil, observed_at: nil, change_30_days: nil, points: []) ⇒ Row

Mirrors the immutable row contract one-for-one.
rubocop:disable Metrics/ParameterLists



35
36
37
38
39
40
41
42
# File 'app/services/amazon/sales_rank_metrics.rb', line 35

def initialize(
  catalog_item_id: nil, item_id: nil, sku: nil, asin: nil,
  amazon_url: nil, category_kind: nil, category_id: nil,
  category_name: nil, current_rank: nil, observed_on: nil,
  observed_at: nil, change_30_days: nil, points: []
)
  super
end

Instance Attribute Details

#amazon_urlObject (readonly)

Returns the value of attribute amazon_url

Returns:

  • (Object)

    the current value of amazon_url



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def amazon_url
  @amazon_url
end

#asinObject (readonly)

Returns the value of attribute asin

Returns:

  • (Object)

    the current value of asin



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def asin
  @asin
end

#catalog_item_idObject (readonly)

Returns the value of attribute catalog_item_id

Returns:

  • (Object)

    the current value of catalog_item_id



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def catalog_item_id
  @catalog_item_id
end

#category_idObject (readonly)

Returns the value of attribute category_id

Returns:

  • (Object)

    the current value of category_id



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def category_id
  @category_id
end

#category_kindObject (readonly)

Returns the value of attribute category_kind

Returns:

  • (Object)

    the current value of category_kind



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def category_kind
  @category_kind
end

#category_nameObject (readonly)

Returns the value of attribute category_name

Returns:

  • (Object)

    the current value of category_name



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def category_name
  @category_name
end

#change_30_daysObject (readonly)

Returns the value of attribute change_30_days

Returns:

  • (Object)

    the current value of change_30_days



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def change_30_days
  @change_30_days
end

#current_rankObject (readonly)

Returns the value of attribute current_rank

Returns:

  • (Object)

    the current value of current_rank



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def current_rank
  @current_rank
end

#item_idObject (readonly)

Returns the value of attribute item_id

Returns:

  • (Object)

    the current value of item_id



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def item_id
  @item_id
end

#observed_atObject (readonly)

Returns the value of attribute observed_at

Returns:

  • (Object)

    the current value of observed_at



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def observed_at
  @observed_at
end

#observed_onObject (readonly)

Returns the value of attribute observed_on

Returns:

  • (Object)

    the current value of observed_on



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def observed_on
  @observed_on
end

#pointsObject (readonly)

Returns the value of attribute points

Returns:

  • (Object)

    the current value of points



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def points
  @points
end

#skuObject (readonly)

Returns the value of attribute sku

Returns:

  • (Object)

    the current value of sku



18
19
20
# File 'app/services/amazon/sales_rank_metrics.rb', line 18

def sku
  @sku
end

Instance Method Details

#chart_nameObject

rubocop:enable Metrics/ParameterLists



45
46
47
# File 'app/services/amazon/sales_rank_metrics.rb', line 45

def chart_name
  "#{sku}#{category_name}"
end