Class: OAuth2::User

Inherits:
Object
  • Object
show all
Defined in:
lib/oauth20/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ User

Returns a new instance of User.



5
6
7
8
# File 'lib/oauth20/user.rb', line 5

def initialize(data)
  @email = data[:email]
  @password = data[:password]
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'lib/oauth20/user.rb', line 3

def email
  @email
end

#passwordObject (readonly)

Returns the value of attribute password.



3
4
5
# File 'lib/oauth20/user.rb', line 3

def password
  @password
end

Class Method Details

.allObject



18
19
20
# File 'lib/oauth20/user.rb', line 18

def self.all
  OAuth2::Storage.instance.user_all()
end

.find_by_email(email) ⇒ Object



14
15
16
# File 'lib/oauth20/user.rb', line 14

def self.find_by_email(email)
  OAuth2::Storage.instance.user_find_by_email(email)
end

Instance Method Details

#saveObject



10
11
12
# File 'lib/oauth20/user.rb', line 10

def save
  OAuth2::Storage.instance.user_save(self)
end