Module: Loginza

Defined in:
lib/loginza.rb,
lib/loginza/api.rb,
lib/loginza/utils.rb,
lib/loginza/railtie.rb,
lib/loginza/version.rb,
lib/loginza/view_helper.rb

Defined Under Namespace

Modules: Api, Utils, Version, ViewHelper Classes: ApiError, Railtie, ServerError, ServiceUnavailableError

Class Method Summary collapse

Class Method Details

.auth_info(token, options = {}) ⇒ Object



23
24
25
# File 'lib/loginza.rb', line 23

def self.auth_info(token, options = {})
  Api.call('authinfo', options.merge(:token => token))
end

.user_data(token, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/loginza.rb', line 10

def self.user_data(token, options = {})
  options = options.dup

  data = begin
    auth_info(token, options)
  rescue ServerError
    return nil if $!.to_s=~/Data not found/
    raise
  end

  block_given? ? yield(data) : data
end