Class: Maestrano::SSO::BaseMembership

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(saml_response) ⇒ BaseMembership

Initializer

Parameters:

  • Maestrano::SAML::Response


8
9
10
11
12
13
# File 'lib/maestrano/sso/base_membership.rb', line 8

def initialize(saml_response)
  att = saml_response.attributes
  @user_uid = att['uid']
  @group_uid = att['group_uid']
  @role = att['group_role']
end

Instance Attribute Details

#group_uidObject (readonly)

Returns the value of attribute group_uid.



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

def group_uid
  @group_uid
end

#roleObject (readonly)

Returns the value of attribute role.



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

def role
  @role
end

#user_uidObject (readonly)

Returns the value of attribute user_uid.



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

def user_uid
  @user_uid
end

Instance Method Details

#to_hashObject



15
16
17
18
19
20
21
22
# File 'lib/maestrano/sso/base_membership.rb', line 15

def to_hash
  {
    provider: 'maestrano',
    group_uid: self.group_uid,
    user_uid: self.user_uid,
    role: self.role
  }
end