Class: OmniAuth::AuthHash::InfoHash

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from KeyStore

override_logging

Class Method Details

.subkey_classObject



30
31
32
# File 'lib/omniauth/auth_hash.rb', line 30

def self.subkey_class
  Hashie::Mash
end

Instance Method Details

#nameObject



34
35
36
37
38
39
40
# File 'lib/omniauth/auth_hash.rb', line 34

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 Also known as: valid?

Returns:

  • (Boolean)


42
43
44
# File 'lib/omniauth/auth_hash.rb', line 42

def name?
  !!name
end

#to_hashObject



47
48
49
50
51
# File 'lib/omniauth/auth_hash.rb', line 47

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