Class: Maestrano::SSO::BaseGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/maestrano/sso/base_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(saml_response) ⇒ BaseGroup

Initializer

Parameters:

  • Maestrano::SAML::Response


11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/maestrano/sso/base_group.rb', line 11

def initialize(saml_response)
  att = saml_response.attributes
  @uid = att['group_uid']
  @has_credit_card = (att['group_has_credit_card'] == 'true')
  @free_trial_end_at = Time.iso8601(att['group_end_free_trial'])
  @company_name = att['company_name']
  @name = att['group_name']
  @org_uid = att['group_org_uid']
  @email = att['group_email']
  @city = att['group_city']
  @timezone = att['group_timezone']
  @currency = att['group_currency']
  @country = att['country']
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def city
  @city
end

#company_nameObject (readonly)

Returns the value of attribute company_name.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def company_name
  @company_name
end

#countryObject (readonly)

Returns the value of attribute country.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def currency
  @currency
end

#emailObject (readonly)

Returns the value of attribute email.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def email
  @email
end

#free_trial_end_atObject (readonly)

Returns the value of attribute free_trial_end_at.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def free_trial_end_at
  @free_trial_end_at
end

#has_credit_cardObject (readonly)

Returns the value of attribute has_credit_card.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def has_credit_card
  @has_credit_card
end

#local_idObject

Returns the value of attribute local_id.



4
5
6
# File 'lib/maestrano/sso/base_group.rb', line 4

def local_id
  @local_id
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def name
  @name
end

#org_uidObject (readonly)

Returns the value of attribute org_uid.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def org_uid
  @org_uid
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def timezone
  @timezone
end

#uidObject (readonly)

Returns the value of attribute uid.



5
6
7
# File 'lib/maestrano/sso/base_group.rb', line 5

def uid
  @uid
end

Instance Method Details

#to_hashObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/maestrano/sso/base_group.rb', line 26

def to_hash
  {
    provider: 'maestrano',
    uid: self.uid,
    info: {
      free_trial_end_at: self.free_trial_end_at,
      company_name: self.company_name,
      has_credit_card: self.has_credit_card,
      name: self.name,
      org_uid: self.org_uid,
      email: self.email,
      city: self.city,
      country: self.country,
      timezone: self.timezone,
      currency: self.currency
    },
    extra: {}
  }
end