Class: ProcessingKz::GoodsItem
- Inherits:
-
Object
- Object
- ProcessingKz::GoodsItem
- Defined in:
- lib/processing_kz/goods_item.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency_code ⇒ Object
readonly
Returns the value of attribute currency_code.
-
#good_id ⇒ Object
readonly
Returns the value of attribute good_id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ GoodsItem
constructor
A new instance of GoodsItem.
- #merchants_goods_id ⇒ Object
- #name_of_goods ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ GoodsItem
Returns a new instance of GoodsItem.
9 10 11 12 13 14 |
# File 'lib/processing_kz/goods_item.rb', line 9 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 |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
4 5 6 |
# File 'lib/processing_kz/goods_item.rb', line 4 def amount @amount end |
#currency_code ⇒ Object (readonly)
Returns the value of attribute currency_code.
4 5 6 |
# File 'lib/processing_kz/goods_item.rb', line 4 def currency_code @currency_code end |
#good_id ⇒ Object (readonly)
Returns the value of attribute good_id.
4 5 6 |
# File 'lib/processing_kz/goods_item.rb', line 4 def good_id @good_id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/processing_kz/goods_item.rb', line 4 def title @title end |
Instance Method Details
#merchants_goods_id ⇒ Object
16 17 18 |
# File 'lib/processing_kz/goods_item.rb', line 16 def merchants_goods_id @good_id end |
#name_of_goods ⇒ Object
20 21 22 |
# File 'lib/processing_kz/goods_item.rb', line 20 def name_of_goods @title end |
#to_hash ⇒ Object
24 25 26 |
# File 'lib/processing_kz/goods_item.rb', line 24 def to_hash { currency_code: @currency_code, name_of_goods: name_of_goods, merchants_goods_id: merchants_goods_id, amount: @amount } end |