Class: Sorenson::ThreeSixty::AccountSummary

Inherits:
Base
  • Object
show all
Defined in:
lib/sorenson/threesixty/account_summary.rb

Constant Summary

Constants inherited from Base

Base::TOKEN_SALT

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

debug=, debug?, host, #post_to, post_to, protocol, token_for, use_ssl=, use_ssl?

Constructor Details

#initialize(data) ⇒ AccountSummary

Instance Methods



20
21
22
23
24
25
26
27
# File 'lib/sorenson/threesixty/account_summary.rb', line 20

def initialize(data)
  self.username               = data['username']
  self.status                 = data['status']
  self.id                     = data['id']
  self.ratePlanExpirationDate = data['ratePlanExpirationDate']
  self.chosenRatePlan         = data['chosenRatePlan']
  self.lastLoginTime          = data['lastLoginTime']
end

Instance Attribute Details

#chosenRatePlanObject

Attributes



6
7
8
# File 'lib/sorenson/threesixty/account_summary.rb', line 6

def chosenRatePlan
  @chosenRatePlan
end

#idObject

Attributes



6
7
8
# File 'lib/sorenson/threesixty/account_summary.rb', line 6

def id
  @id
end

#lastLoginTimeObject

Attributes



6
7
8
# File 'lib/sorenson/threesixty/account_summary.rb', line 6

def lastLoginTime
  @lastLoginTime
end

#ratePlanExpirationDateObject

Attributes



6
7
8
# File 'lib/sorenson/threesixty/account_summary.rb', line 6

def ratePlanExpirationDate
  @ratePlanExpirationDate
end

#statusObject

Attributes



6
7
8
# File 'lib/sorenson/threesixty/account_summary.rb', line 6

def status
  @status
end

#usernameObject

Attributes



6
7
8
# File 'lib/sorenson/threesixty/account_summary.rb', line 6

def username
  @username
end

Class Method Details

.getAccountSummariesObject

Class Methods



9
10
11
12
13
14
15
16
# File 'lib/sorenson/threesixty/account_summary.rb', line 9

def self.getAccountSummaries
  data = post_to("/api/getAllAccounts")
  summaries = []
  data['accounts'].each do ||
    summaries << AccountSummary.new()
  end
  summaries
end