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


9
10
11
12
13
14
15
# File 'lib/maestrano/sso/base_group.rb', line 9

def initialize(saml_response)
  att = saml_response.attributes
  @uid = att['group_uid']
  @country = att['country']
  @free_trial_end_at = Time.iso8601(att['group_end_free_trial'])
  @company_name = att['company_name']
end

Instance Attribute Details

#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

#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

#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

#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



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/maestrano/sso/base_group.rb', line 17

def to_hash
  {
    provider: 'maestrano',
    uid: self.uid,
    info: {
      free_trial_end_at: self.free_trial_end_at,
      company_name: self.company_name,
      country: self.country,
    },
    extra: {}
  }
end