Class: DPay::Refund
- Inherits:
-
Object
- Object
- DPay::Refund
- Defined in:
- lib/dpay/refund/refund.rb,
sig/dpay/refund/refund.rbs
Instance Attribute Summary collapse
-
#message ⇒ String?
readonly
Returns the value of attribute message.
-
#raw ⇒ Hash[String, untyped]
readonly
Returns the value of attribute raw.
Class Method Summary collapse
Instance Method Summary collapse
- #accepted? ⇒ Boolean
-
#initialize(data) ⇒ Refund
constructor
A new instance of Refund.
Constructor Details
#initialize(data) ⇒ Refund
Returns a new instance of Refund.
11 12 13 14 15 16 |
# File 'lib/dpay/refund/refund.rb', line 11 def initialize(data) @raw = data @accepted = data["status"] == "success" && data["refund"] == true = Internal::Coerce.string(data["message"]) freeze end |
Instance Attribute Details
#message ⇒ String? (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/dpay/refund/refund.rb', line 5 def end |
#raw ⇒ Hash[String, untyped] (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/dpay/refund/refund.rb', line 5 def raw @raw end |
Class Method Details
.from_api(data) ⇒ Refund
7 8 9 |
# File 'lib/dpay/refund/refund.rb', line 7 def self.from_api(data) new(data) end |
Instance Method Details
#accepted? ⇒ Boolean
18 19 20 |
# File 'lib/dpay/refund/refund.rb', line 18 def accepted? @accepted end |