Class: Square::Connect::Refund
- Defined in:
- lib/square/connect/refund.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#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.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(*args) ⇒ Refund
constructor
A new instance of Refund.
Methods inherited from Node
Constructor Details
#initialize(*args) ⇒ 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 |
# File 'lib/square/connect/refund.rb', line 6 def initialize(*args) super do |attributes| self.type = attributes[:type] self.reason = attributes[:reason] self.refunded_money = if attributes[:refunded_money].present? 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 = attributes[:payment] || 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 |
#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 |