class Memerator::User
A user is a Memerator
User
. Data everyone (with a token) can access
Public Class Methods
new(data)
click to toggle source
@!visibility private
# File lib/memerator/user.rb, line 4 def initialize(data) @data = data end
Public Instance Methods
bio()
click to toggle source
@return [String] the user's bio
# File lib/memerator/user.rb, line 19 def bio @data['bio'] end
followers()
click to toggle source
@return [Integer] the amount of followers this user has
# File lib/memerator/user.rb, line 24 def followers @data['stats']['followers'] end
following()
click to toggle source
@return [Integer] the amount of users this user is following
# File lib/memerator/user.rb, line 29 def following @data['stats']['following'] end
id()
click to toggle source
@return [Integer] the user's ID
# File lib/memerator/user.rb, line 14 def id @data['id'] end
joined()
click to toggle source
@return [Time] the user's join time
# File lib/memerator/user.rb, line 64 def joined Time.parse(@data['joined']) end
link()
click to toggle source
@return [String] the user's profile link
# File lib/memerator/user.rb, line 59 def link @data['permalink'] end
memes()
click to toggle source
@return [Integer] the amount of memes this user has
# File lib/memerator/user.rb, line 34 def memes @data['stats']['memes'] end
pro?()
click to toggle source
@return [true, false] the user's pro status
# File lib/memerator/user.rb, line 54 def pro? @data['perks']['pro'] end
staff?()
click to toggle source
@return [true, false] the user's staff member status
# File lib/memerator/user.rb, line 44 def staff? @data['perks']['staff'] end
translator?()
click to toggle source
@return [true, false] the user's translator status
# File lib/memerator/user.rb, line 49 def translator? @data['perks']['translator'] end
username()
click to toggle source
@return [String] the user's username
# File lib/memerator/user.rb, line 9 def username @data['username'] end
verified?()
click to toggle source
@return [true, false] the user's verification status
# File lib/memerator/user.rb, line 39 def verified? @data['perks']['verified'] end