Class: Messenger::Elements::Item

Inherits:
Object
  • Object
show all
Includes:
Components::Element
Defined in:
lib/messenger/components/elements/receipt/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Components::Element

#build, #build_elements

Constructor Details

#initialize(title:, subtitle: nil, quantity: nil, price: nil, currency: nil, image_url: nil) ⇒ Item

Returns a new instance of Item.



10
11
12
13
14
15
16
17
# File 'lib/messenger/components/elements/receipt/item.rb', line 10

def initialize(title:, subtitle: nil, quantity: nil, price: nil, currency: nil, image_url: nil)
  @title     = title
  @subtitle  = subtitle
  @quantity  = quantity
  @price     = price
  @currency  = currency
  @image_url = image_url
end

Instance Attribute Details

#currencyObject

Returns the value of attribute currency.



8
9
10
# File 'lib/messenger/components/elements/receipt/item.rb', line 8

def currency
  @currency
end

#image_urlObject

Returns the value of attribute image_url.



8
9
10
# File 'lib/messenger/components/elements/receipt/item.rb', line 8

def image_url
  @image_url
end

#priceObject

Returns the value of attribute price.



8
9
10
# File 'lib/messenger/components/elements/receipt/item.rb', line 8

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



8
9
10
# File 'lib/messenger/components/elements/receipt/item.rb', line 8

def quantity
  @quantity
end

#subtitleObject

Returns the value of attribute subtitle.



8
9
10
# File 'lib/messenger/components/elements/receipt/item.rb', line 8

def subtitle
  @subtitle
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/messenger/components/elements/receipt/item.rb', line 8

def title
  @title
end