Class: DPay::PayoutReceiver
- Inherits:
-
Object
- Object
- DPay::PayoutReceiver
- Defined in:
- lib/dpay/payout/payout_receiver.rb,
sig/dpay/payout/payout_receiver.rbs
Instance Attribute Summary collapse
-
#amount ⇒ Money?
readonly
Returns the value of attribute amount.
-
#nrb ⇒ String?
readonly
Returns the value of attribute nrb.
-
#raw ⇒ Hash[String, untyped]
readonly
Returns the value of attribute raw.
-
#receiver_address ⇒ String?
readonly
Returns the value of attribute receiver_address.
-
#receiver_name ⇒ String?
readonly
Returns the value of attribute receiver_name.
-
#service ⇒ String?
readonly
Returns the value of attribute service.
-
#title ⇒ String?
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ PayoutReceiver
constructor
A new instance of PayoutReceiver.
Constructor Details
#initialize(data) ⇒ PayoutReceiver
Returns a new instance of PayoutReceiver.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dpay/payout/payout_receiver.rb', line 11 def initialize(data) @raw = data @nrb = data["nrb"].is_a?(String) ? data["nrb"] : nil @title = data["title"].is_a?(String) ? data["title"] : nil @amount = Money.try_from_api_number(data["amount"], Currency::PLN) @service = data["service"].is_a?(String) ? data["service"] : nil @receiver_name = data["receiverName"].is_a?(String) ? data["receiverName"] : nil @receiver_address = data["receiverAddress"].is_a?(String) ? data["receiverAddress"] : nil freeze end |
Instance Attribute Details
#amount ⇒ Money? (readonly)
Returns the value of attribute amount.
5 6 7 |
# File 'lib/dpay/payout/payout_receiver.rb', line 5 def amount @amount end |
#nrb ⇒ String? (readonly)
Returns the value of attribute nrb.
5 6 7 |
# File 'lib/dpay/payout/payout_receiver.rb', line 5 def nrb @nrb end |
#raw ⇒ Hash[String, untyped] (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/dpay/payout/payout_receiver.rb', line 5 def raw @raw end |
#receiver_address ⇒ String? (readonly)
Returns the value of attribute receiver_address.
5 6 7 |
# File 'lib/dpay/payout/payout_receiver.rb', line 5 def receiver_address @receiver_address end |
#receiver_name ⇒ String? (readonly)
Returns the value of attribute receiver_name.
5 6 7 |
# File 'lib/dpay/payout/payout_receiver.rb', line 5 def receiver_name @receiver_name end |
#service ⇒ String? (readonly)
Returns the value of attribute service.
5 6 7 |
# File 'lib/dpay/payout/payout_receiver.rb', line 5 def service @service end |
#title ⇒ String? (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/dpay/payout/payout_receiver.rb', line 5 def title @title end |
Class Method Details
.from_api(data) ⇒ PayoutReceiver
7 8 9 |
# File 'lib/dpay/payout/payout_receiver.rb', line 7 def self.from_api(data) new(data) end |