Class: DPay::BlikAlias
- Inherits:
-
Object
- Object
- DPay::BlikAlias
- Defined in:
- lib/dpay/blik/blik_alias.rb,
sig/dpay/blik/blik_alias.rbs
Constant Summary collapse
- ACTIVE =
"ACTIVE"
Instance Attribute Summary collapse
-
#alias_type ⇒ String
readonly
Returns the value of attribute alias_type.
-
#alias_value ⇒ String
readonly
Returns the value of attribute alias_value.
-
#apps ⇒ Array[BlikApp]
readonly
Returns the value of attribute apps.
-
#expiration_date ⇒ String?
readonly
Returns the value of attribute expiration_date.
-
#raw ⇒ Hash[String, untyped]
readonly
Returns the value of attribute raw.
-
#status ⇒ String?
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(data) ⇒ BlikAlias
constructor
A new instance of BlikAlias.
Constructor Details
#initialize(data) ⇒ BlikAlias
Returns a new instance of BlikAlias.
13 14 15 16 17 18 19 20 21 |
# File 'lib/dpay/blik/blik_alias.rb', line 13 def initialize(data) @raw = data @alias_value = Internal::Coerce.string(data["alias_value"]) || "" @alias_type = Internal::Coerce.string(data["alias_type"]) || BlikAliasType::UID @status = data["status"].is_a?(String) ? data["status"] : nil @expiration_date = data["expiration_date"].is_a?(String) ? data["expiration_date"] : nil @apps = Internal::Coerce.list(data["apps"]).map { |app| BlikApp.from_api(app) } freeze end |
Instance Attribute Details
#alias_type ⇒ String (readonly)
Returns the value of attribute alias_type.
7 8 9 |
# File 'lib/dpay/blik/blik_alias.rb', line 7 def alias_type @alias_type end |
#alias_value ⇒ String (readonly)
Returns the value of attribute alias_value.
7 8 9 |
# File 'lib/dpay/blik/blik_alias.rb', line 7 def alias_value @alias_value end |
#apps ⇒ Array[BlikApp] (readonly)
Returns the value of attribute apps.
7 8 9 |
# File 'lib/dpay/blik/blik_alias.rb', line 7 def apps @apps end |
#expiration_date ⇒ String? (readonly)
Returns the value of attribute expiration_date.
7 8 9 |
# File 'lib/dpay/blik/blik_alias.rb', line 7 def expiration_date @expiration_date end |
#raw ⇒ Hash[String, untyped] (readonly)
Returns the value of attribute raw.
7 8 9 |
# File 'lib/dpay/blik/blik_alias.rb', line 7 def raw @raw end |
#status ⇒ String? (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/dpay/blik/blik_alias.rb', line 7 def status @status end |
Class Method Details
.from_api(data) ⇒ BlikAlias
9 10 11 |
# File 'lib/dpay/blik/blik_alias.rb', line 9 def self.from_api(data) new(data) end |
Instance Method Details
#active? ⇒ Boolean
23 24 25 |
# File 'lib/dpay/blik/blik_alias.rb', line 23 def active? @status == ACTIVE end |