Sha256: 492936df2bf81558deabc1cdfebde14916ff085c6c57d5beea1405254c08656b

Contents?: true

Size: 612 Bytes

Versions: 5

Compression:

Stored size: 612 Bytes

Contents

module ProcessingKz
  class GoodsItem

    attr_reader :title,
                :good_id,
                :amount,
                :currency_code

    def initialize(args = {})
      @currency_code = args[:currency_code] || Config.currency_code
      @title = args[:title]
      @good_id = args[:good_id]
      @amount = (args[:amount] * 100).to_i
    end

    def merchants_goods_id
      @good_id
    end

    def name_of_goods
      @title
    end

    def to_hash
      { currency_code: @currency_code, name_of_goods: name_of_goods, merchants_goods_id: merchants_goods_id, amount: @amount }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
processing_kz-0.1.44 lib/processing_kz/goods_item.rb
processing_kz-0.1.43 lib/processing_kz/goods_item.rb
processing_kz-0.1.42 lib/processing_kz/goods_item.rb
processing_kz-0.1.41 lib/processing_kz/goods_item.rb
processing_kz-0.1.4 lib/processing_kz/goods_item.rb