Class: Subsify::Customer
- Inherits:
-
Object
- Object
- Subsify::Customer
- Defined in:
- lib/subsify/customer.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#card ⇒ Object
readonly
Returns the value of attribute card.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#subscription ⇒ Object
readonly
Returns the value of attribute subscription.
Instance Method Summary collapse
-
#initialize(data) ⇒ Customer
constructor
A new instance of Customer.
Constructor Details
#initialize(data) ⇒ Customer
Returns a new instance of Customer.
5 6 7 8 9 10 |
# File 'lib/subsify/customer.rb', line 5 def initialize(data) @id = data['id'] @account = Account.new(data['account']) if data['account'] @subscription = Subscription.new(data['subscription']) if data['subscription'] @card = Card.new(data['card']) if data['card'] end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
4 5 6 |
# File 'lib/subsify/customer.rb', line 4 def account @account end |
#card ⇒ Object (readonly)
Returns the value of attribute card.
4 5 6 |
# File 'lib/subsify/customer.rb', line 4 def card @card end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/subsify/customer.rb', line 4 def id @id end |
#subscription ⇒ Object (readonly)
Returns the value of attribute subscription.
4 5 6 |
# File 'lib/subsify/customer.rb', line 4 def subscription @subscription end |