Class: Sorenson::Services::Subaccount

Inherits:
Base show all
Defined in:
lib/sorenson/services/subaccount.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

delete_from, get_from, host, login_no_resource, parse_response, post_to, put_to, verify_account_settings

Constructor Details

#initialize(account, data) ⇒ Subaccount

Instance Methods



12
13
14
15
16
17
18
19
20
# File 'lib/sorenson/services/subaccount.rb', line 12

def initialize(, data)
  self.                  = 
  self.username                 = data['username']
  self.id                       = data['id']
  self.status                   = data['status']
  self.accountId                = data['accountId']
  self.email                    = data['email']
  self.dateRetrieved            = data['dateRetrieved']
end

Instance Attribute Details

#accountObject

Attributes



6
7
8
# File 'lib/sorenson/services/subaccount.rb', line 6

def 
  @account
end

#accountIdObject

Attributes



6
7
8
# File 'lib/sorenson/services/subaccount.rb', line 6

def accountId
  @accountId
end

#dateRetrievedObject

Attributes



6
7
8
# File 'lib/sorenson/services/subaccount.rb', line 6

def dateRetrieved
  @dateRetrieved
end

#emailObject

Attributes



6
7
8
# File 'lib/sorenson/services/subaccount.rb', line 6

def email
  @email
end

#idObject

Attributes



6
7
8
# File 'lib/sorenson/services/subaccount.rb', line 6

def id
  @id
end

#statusObject

Attributes



6
7
8
# File 'lib/sorenson/services/subaccount.rb', line 6

def status
  @status
end

#usernameObject

Attributes



6
7
8
# File 'lib/sorenson/services/subaccount.rb', line 6

def username
  @username
end

Instance Method Details

#activate!Object



22
23
24
# File 'lib/sorenson/services/subaccount.rb', line 22

def activate!
  Base.put_to("/subaccounts/#{id}/activate")
end

#deactivate!Object



26
27
28
# File 'lib/sorenson/services/subaccount.rb', line 26

def deactivate!
  Base.put_to("/subaccounts/#{id}/deactivate")
end