Class: E621::User
- Inherits:
-
Object
- Object
- E621::User
- Defined in:
- lib/rubyhexagon/user.rb
Overview
Class to hold user information for users on e621.
Instance Attribute Summary collapse
-
#created_at ⇒ Time
readonly
Registration time of this user.
-
#id ⇒ Integer
readonly
Id of user.
-
#level ⇒ Level
readonly
Level of access, this user holds.
-
#name ⇒ String
readonly
Name of user.
Instance Method Summary collapse
-
#==(other) ⇒ TrueClass, FalseClass
Comparison method for User objects.
-
#initialize(user) ⇒ Object
constructor
Initializer for User.
-
#show ⇒ User
Returns a filled User object.
-
#show! ⇒ Object
Fill this object with user data.
Constructor Details
#initialize(user) ⇒ Object
Initializer for User.
44 45 46 47 |
# File 'lib/rubyhexagon/user.rb', line 44 def initialize(user) @id = user[:id].to_i @name = user[:name] end |
Instance Attribute Details
#created_at ⇒ Time (readonly)
Returns registration time of this user.
35 36 37 |
# File 'lib/rubyhexagon/user.rb', line 35 def created_at @created_at end |
#id ⇒ Integer (readonly)
Returns id of user.
26 27 28 |
# File 'lib/rubyhexagon/user.rb', line 26 def id @id end |
#level ⇒ Level (readonly)
Returns level of access, this user holds.
32 33 34 |
# File 'lib/rubyhexagon/user.rb', line 32 def level @level end |
#name ⇒ String (readonly)
Returns name of user.
29 30 31 |
# File 'lib/rubyhexagon/user.rb', line 29 def name @name end |
Instance Method Details
#==(other) ⇒ TrueClass, FalseClass
Comparison method for User objects
74 75 76 |
# File 'lib/rubyhexagon/user.rb', line 74 def ==(other) other.is_a?(User) && @id == other.id && @name == other.name end |