Class: User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- User
- Defined in:
- lib/wpb/user.rb
Overview
This class is used for getting the user from the wordpress database
Examples:
User.find(1).name
The above will find the user with id of 1 and retrieve their display name
Instance Method Summary collapse
-
#email ⇒ Object
Grab the email of the selected user.
-
#email=(email) ⇒ Object
Set the email of the selected user.
-
#name ⇒ Object
Grab the name of the selected user.
-
#name=(name) ⇒ Object
Set the name of the selected user.
-
#username ⇒ Object
Grab the username of the selected user.
-
#username=(username) ⇒ Object
Set the username of the selected user.
Instance Method Details
#email ⇒ Object
Grab the email of the selected user
50 51 52 |
# File 'lib/wpb/user.rb', line 50 def email user_email end |
#email=(email) ⇒ Object
Set the email of the selected user
57 58 59 |
# File 'lib/wpb/user.rb', line 57 def email= email self.user_email = email end |
#name ⇒ Object
Grab the name of the selected user
22 23 24 |
# File 'lib/wpb/user.rb', line 22 def name display_name end |
#name=(name) ⇒ Object
Set the name of the selected user
29 30 31 |
# File 'lib/wpb/user.rb', line 29 def name= name self.display_name = name end |
#username ⇒ Object
Grab the username of the selected user
36 37 38 |
# File 'lib/wpb/user.rb', line 36 def username user_login end |
#username=(username) ⇒ Object
Set the username of the selected user
43 44 45 |
# File 'lib/wpb/user.rb', line 43 def username= username self.user_login = username end |