Class: OmniAuth::AuthHash::InfoHash

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/omniauth/auth_hash.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.subkey_classObject



28
# File 'lib/omniauth/auth_hash.rb', line 28

def self.subkey_class; Hashie::Mash end

Instance Method Details

#nameObject



30
31
32
33
34
35
36
# File 'lib/omniauth/auth_hash.rb', line 30

def name
  return self[:name] if self[:name]
  return "#{first_name} #{last_name}".strip if first_name? || last_name?
  return nickname if nickname?
  return email if email?
  nil
end

#name?Boolean

Returns:

  • (Boolean)


38
# File 'lib/omniauth/auth_hash.rb', line 38

def name?; !!name end

#to_hashObject



44
45
46
47
48
# File 'lib/omniauth/auth_hash.rb', line 44

def to_hash
  hash = super
  hash['name'] ||= name
  hash
end

#valid?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/omniauth/auth_hash.rb', line 40

def valid?
  name?
end