Class: EverboxClient::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/everbox_client/models/account.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Account

Returns a new instance of Account.



3
4
5
# File 'lib/everbox_client/models/account.rb', line 3

def initialize(data)
  @data = data
end

Instance Method Details

#google?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/everbox_client/models/account.rb', line 7

def google?
  @data["type"] == 'google'
end

#sdo?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/everbox_client/models/account.rb', line 11

def sdo?
  @data["type"] == 'sdo'
end

#to_sObject



15
16
17
18
19
20
21
22
23
# File 'lib/everbox_client/models/account.rb', line 15

def to_s
  if google?
    "Google Account: #{@data["email"]}"
  elsif sdo?
    "SDO Account: #{@data["name"]}"
  else
    "Unknown Account Type: #{@data["type"]}"
  end
end