Class: DPay::Bank
- Inherits:
-
Object
- Object
- DPay::Bank
- Defined in:
- lib/dpay/bank/bank.rb,
sig/dpay/bank/bank.rbs
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
Returns the value of attribute id.
-
#image ⇒ String?
readonly
Returns the value of attribute image.
-
#iterator ⇒ Integer?
readonly
Returns the value of attribute iterator.
-
#name ⇒ String
readonly
Returns the value of attribute name.
-
#on_from ⇒ Integer
readonly
Returns the value of attribute on_from.
-
#on_to ⇒ Integer
readonly
Returns the value of attribute on_to.
-
#raw ⇒ Hash[String, untyped]
readonly
Returns the value of attribute raw.
-
#type ⇒ String?
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Bank
constructor
A new instance of Bank.
- #test? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Bank
Returns a new instance of Bank.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dpay/bank/bank.rb', line 11 def initialize(data) @raw = data @id = Internal::Coerce.string(data["id"]) || "" @name = Internal::Coerce.string(data["name"]) || "" @image = data["image"].is_a?(String) ? data["image"] : nil @on_from = Internal::Coerce.integer(data["on_from"]) @on_to = Internal::Coerce.integer(data["on_to"]) @iterator = data["iterator"].nil? ? nil : Internal::Coerce.integer(data["iterator"]) @test = Internal::Coerce.boolean(data["test"]) @type = data["type"].is_a?(String) ? data["type"] : nil freeze end |
Instance Attribute Details
#id ⇒ String (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def id @id end |
#image ⇒ String? (readonly)
Returns the value of attribute image.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def image @image end |
#iterator ⇒ Integer? (readonly)
Returns the value of attribute iterator.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def iterator @iterator end |
#name ⇒ String (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def name @name end |
#on_from ⇒ Integer (readonly)
Returns the value of attribute on_from.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def on_from @on_from end |
#on_to ⇒ Integer (readonly)
Returns the value of attribute on_to.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def on_to @on_to end |
#raw ⇒ Hash[String, untyped] (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def raw @raw end |
#type ⇒ String? (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/dpay/bank/bank.rb', line 5 def type @type end |
Class Method Details
.from_api(data) ⇒ Bank
7 8 9 |
# File 'lib/dpay/bank/bank.rb', line 7 def self.from_api(data) new(data) end |
Instance Method Details
#test? ⇒ Boolean
24 25 26 |
# File 'lib/dpay/bank/bank.rb', line 24 def test? @test end |