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

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

Instance Method Summary collapse

Instance Method Details

#sso_authenticate(*args) ⇒ Object



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

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

#sso_authorize(*args) ⇒ Object



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

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

#sso_cache(resource, _action = nil) ⇒ Object



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

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

#sso_consume(*args) ⇒ Object



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

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

#sso_find(id) ⇒ Object



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

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