Class: Subsify::Customer

Inherits:
Object
  • Object
show all
Defined in:
lib/subsify/customer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#accountObject (readonly)

Returns the value of attribute account.



4
5
6
# File 'lib/subsify/customer.rb', line 4

def 
  @account
end

#cardObject (readonly)

Returns the value of attribute card.



4
5
6
# File 'lib/subsify/customer.rb', line 4

def card
  @card
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/subsify/customer.rb', line 4

def id
  @id
end

#subscriptionObject (readonly)

Returns the value of attribute subscription.



4
5
6
# File 'lib/subsify/customer.rb', line 4

def subscription
  @subscription
end