Class: Cadooz::Immutable::Payment
- Inherits:
-
Object
- Object
- Cadooz::Immutable::Payment
- Includes:
- Mixins
- Defined in:
- lib/cadooz/models/immutable/payment.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#paid ⇒ Object
readonly
Returns the value of attribute paid.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#verified ⇒ Object
readonly
Returns the value of attribute verified.
Instance Method Summary collapse
-
#initialize(open_struct) ⇒ Payment
constructor
A new instance of Payment.
Methods included from Mixins
#cadooz_class, #default_value_for_nil, #instance_variables_empty?, #serialize
Constructor Details
#initialize(open_struct) ⇒ Payment
Returns a new instance of Payment.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cadooz/models/immutable/payment.rb', line 6 def initialize(open_struct) @attributes = open_struct&.attributes &.map_entries &.elements &.inject({}) { |hash, element| hash.merge(element.key.to_sym => element.value) } @description = open_struct&.description @paid = open_struct&.paid @type = open_struct&.type @value = open_struct&.value @verified = open_struct&.verified self.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/cadooz/models/immutable/payment.rb', line 4 def attributes @attributes end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/cadooz/models/immutable/payment.rb', line 4 def description @description end |
#paid ⇒ Object (readonly)
Returns the value of attribute paid.
4 5 6 |
# File 'lib/cadooz/models/immutable/payment.rb', line 4 def paid @paid end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/cadooz/models/immutable/payment.rb', line 4 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/cadooz/models/immutable/payment.rb', line 4 def value @value end |
#verified ⇒ Object (readonly)
Returns the value of attribute verified.
4 5 6 |
# File 'lib/cadooz/models/immutable/payment.rb', line 4 def verified @verified end |