Class: Square::Connect::Tender
- Inherits:
-
Object
- Object
- Square::Connect::Tender
- Defined in:
- lib/square/connect/tender.rb
Instance Attribute Summary collapse
-
#card_brand ⇒ Object
Returns the value of attribute card_brand.
-
#change_back_money ⇒ Object
Returns the value of attribute change_back_money.
-
#entry_method ⇒ Object
Returns the value of attribute entry_method.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pan_suffix ⇒ Object
Returns the value of attribute pan_suffix.
-
#payment_note ⇒ Object
Returns the value of attribute payment_note.
-
#tendered_money ⇒ Object
Returns the value of attribute tendered_money.
-
#total_money ⇒ Object
Returns the value of attribute total_money.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Tender
constructor
A new instance of Tender.
Constructor Details
#initialize(attributes = {}) ⇒ Tender
Returns a new instance of Tender.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/square/connect/tender.rb', line 6 def initialize(attributes = {}) self.type = attributes[:type] self.name = attributes[:name] self.card_brand = attributes[:card_brand] self.pan_suffix = attributes[:pan_suffix] self.entry_method = attributes[:entry_method] self.payment_note = attributes[:payment_note] [ :total_money, :tendered_money, :change_back_money ].each do |money_attr| if attributes[money_attr] self.send "#{money_attr}=", Money.new(attributes[money_attr]) end end end |
Instance Attribute Details
#card_brand ⇒ Object
Returns the value of attribute card_brand.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def card_brand @card_brand end |
#change_back_money ⇒ Object
Returns the value of attribute change_back_money.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def change_back_money @change_back_money end |
#entry_method ⇒ Object
Returns the value of attribute entry_method.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def entry_method @entry_method end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def name @name end |
#pan_suffix ⇒ Object
Returns the value of attribute pan_suffix.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def pan_suffix @pan_suffix end |
#payment_note ⇒ Object
Returns the value of attribute payment_note.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def payment_note @payment_note end |
#tendered_money ⇒ Object
Returns the value of attribute tendered_money.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def tendered_money @tendered_money end |
#total_money ⇒ Object
Returns the value of attribute total_money.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def total_money @total_money end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/square/connect/tender.rb', line 4 def type @type end |