Class: CloudRailSi::Types::Refund
- Inherits:
-
SandboxObject
- Object
- SandboxObject
- CloudRailSi::Types::Refund
- Defined in:
- lib/cloudrail_si/types/Refund.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#charge_id ⇒ Object
readonly
Returns the value of attribute charge_id.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(amount, charge_id, created, id, state, currency) ⇒ Refund
constructor
A new instance of Refund.
Methods inherited from SandboxObject
Constructor Details
#initialize(amount, charge_id, created, id, state, currency) ⇒ Refund
Returns a new instance of Refund.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cloudrail_si/types/Refund.rb', line 9 def initialize(amount, charge_id, created, id, state, currency) super() @amount = amount @charge_id = charge_id @created = created @id = id @state = state @currency = currency raise Errors::IllegalArgumentError.new("At least one of the parameters is nil.") if (charge_id.nil? || id.nil? || state.nil?) raise Errors::IllegalArgumentError.new("Unknown state. Allowed values are: 'succeeded', 'failed' or 'pending'.") if (["pending", "succeeded", "failed"].index(@state) < 0) raise Errors::IllegalArgumentError.new("The passed currency is invalid.") if (@currency.length != 3) @currency = @currency.upcase end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/cloudrail_si/types/Refund.rb', line 7 def amount @amount end |
#charge_id ⇒ Object (readonly)
Returns the value of attribute charge_id.
7 8 9 |
# File 'lib/cloudrail_si/types/Refund.rb', line 7 def charge_id @charge_id end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
7 8 9 |
# File 'lib/cloudrail_si/types/Refund.rb', line 7 def created @created end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/cloudrail_si/types/Refund.rb', line 7 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/cloudrail_si/types/Refund.rb', line 7 def id @id end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
7 8 9 |
# File 'lib/cloudrail_si/types/Refund.rb', line 7 def state @state end |