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