Module: Bsm::Sso::Client::UserMethods::ClassMethods

Defined in:
lib/bsm/sso/client/user_methods.rb

Instance Method Summary collapse

Instance Method Details

#sso_authenticate(*a) ⇒ Object


22
23
24
25
# File 'lib/bsm/sso/client/user_methods.rb', line 22

def sso_authenticate(*a)
  resource = Bsm::Sso::Client::User.sso_authenticate(*a)
  sso_cache(resource, :authenticate) if resource
end

#sso_authorize(*a) ⇒ Object


27
28
29
30
# File 'lib/bsm/sso/client/user_methods.rb', line 27

def sso_authorize(*a)
  resource = Bsm::Sso::Client::User.sso_authorize(*a)
  sso_cache(resource, :authorize) if resource
end

#sso_cache(resource, action = nil) ⇒ Object


32
33
34
# File 'lib/bsm/sso/client/user_methods.rb', line 32

def sso_cache(resource, action = nil)
  new(resource.attributes)
end

#sso_consume(*a) ⇒ Object


17
18
19
20
# File 'lib/bsm/sso/client/user_methods.rb', line 17

def sso_consume(*a)
  resource = Bsm::Sso::Client::User.sso_consume(*a)
  sso_cache(resource, :consume) if resource
end

#sso_find(id) ⇒ Object


12
13
14
15
# File 'lib/bsm/sso/client/user_methods.rb', line 12

def sso_find(id)
  resource = Bsm::Sso::Client::User.sso_find(id)
  sso_cache(resource, :find) if resource
end