Class: Square::Connect::Refund
- Inherits:
-
Object
- Object
- Square::Connect::Refund
- Defined in:
- lib/square/connect/refund.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#payment ⇒ Object
Returns the value of attribute payment.
-
#processed_at ⇒ Object
Returns the value of attribute processed_at.
-
#reason ⇒ Object
Returns the value of attribute reason.
-
#refunded_money ⇒ Object
Returns the value of attribute refunded_money.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Refund
constructor
A new instance of Refund.
Constructor Details
#initialize(attributes = {}) ⇒ Refund
Returns a new instance of Refund.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/square/connect/refund.rb', line 6 def initialize(attributes = {}) self.identifier = attributes[:id] self.type = attributes[:type] self.reason = attributes[:reason] self.refunded_money = if attributes[:refunded_money] Money.new attributes[:refunded_money] end [ :created_at, :processed_at ].each do |time_key| if attributes[time_key] self.send "#{time_key}=", Time.parse(attributes[time_key]) end end self.payment = if attributes[:payment_id] Payment.new attributes[:payment_id] end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/square/connect/refund.rb', line 4 def created_at @created_at end |
#identifier ⇒ Object
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/square/connect/refund.rb', line 4 def identifier @identifier end |
#payment ⇒ Object
Returns the value of attribute payment.
4 5 6 |
# File 'lib/square/connect/refund.rb', line 4 def payment @payment end |
#processed_at ⇒ Object
Returns the value of attribute processed_at.
4 5 6 |
# File 'lib/square/connect/refund.rb', line 4 def processed_at @processed_at end |
#reason ⇒ Object
Returns the value of attribute reason.
4 5 6 |
# File 'lib/square/connect/refund.rb', line 4 def reason @reason end |
#refunded_money ⇒ Object
Returns the value of attribute refunded_money.
4 5 6 |
# File 'lib/square/connect/refund.rb', line 4 def refunded_money @refunded_money end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/square/connect/refund.rb', line 4 def type @type end |