Class: Messenger::Templates::Receipt
- Inherits:
-
Components::Attachment
- Object
- Components::Attachment
- Messenger::Templates::Receipt
- Defined in:
- lib/messenger/components/templates/receipt.rb
Constant Summary collapse
- ATTRIBUTES =
%w( template_type recipient_name order_number currency payment_method timestamp order_url elements address summary adjustments ).freeze
Instance Method Summary collapse
- #flattened_attributes ⇒ Object
-
#initialize(recipient_name:, order:, elements:, address: nil, summary:, adjustments: nil) ⇒ Receipt
constructor
A new instance of Receipt.
Methods inherited from Components::Attachment
#all_attributes, #allowed_attribute?, #build, #build_elements, #payload
Constructor Details
#initialize(recipient_name:, order:, elements:, address: nil, summary:, adjustments: nil) ⇒ Receipt
Returns a new instance of Receipt.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/messenger/components/templates/receipt.rb', line 20 def initialize(recipient_name:, order:, elements:, address: nil, summary:, adjustments: nil) @type = 'template' @template_type = 'receipt' @recipient_name = recipient_name @order = order @elements = build_elements(elements) @address = address.build @summary = summary.build @adjustments = build_elements(adjustments) end |
Instance Method Details
#flattened_attributes ⇒ Object
31 32 33 |
# File 'lib/messenger/components/templates/receipt.rb', line 31 def flattened_attributes @order.build end |