Class: Fb::Messenger::Template::ReceiptItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fb/messenger/templates/receipt_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ ReceiptItem

Returns a new instance of ReceiptItem.



8
9
10
11
12
13
14
15
# File 'lib/fb/messenger/templates/receipt_item.rb', line 8

def initialize(opts = {})
  @title = opts[:title]
  @subtitle = opts[:subtitle]
  @quantity = opts[:quantity]
  @price = opts[:price]
  @currency = opts[:currency]
  @image_url = opts[:image_url]
end

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



6
7
8
# File 'lib/fb/messenger/templates/receipt_item.rb', line 6

def currency
  @currency
end

#image_urlObject

Returns the value of attribute image_url.



6
7
8
# File 'lib/fb/messenger/templates/receipt_item.rb', line 6

def image_url
  @image_url
end

#priceObject

Returns the value of attribute price.



6
7
8
# File 'lib/fb/messenger/templates/receipt_item.rb', line 6

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



5
6
7
# File 'lib/fb/messenger/templates/receipt_item.rb', line 5

def quantity
  @quantity
end

#subtitleObject

Returns the value of attribute subtitle.



5
6
7
# File 'lib/fb/messenger/templates/receipt_item.rb', line 5

def subtitle
  @subtitle
end

#titleObject

Returns the value of attribute title.



5
6
7
# File 'lib/fb/messenger/templates/receipt_item.rb', line 5

def title
  @title
end

Instance Method Details

#templateObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/fb/messenger/templates/receipt_item.rb', line 17

def template
  {
    title: title,
    subtitle: subtitle,
    quantity: quantity,
    price: price,
    currency: currency,
    image_url: image_url
  }
end