Class: Memerator::User

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

Overview

A user is a Memerator User. Data everyone (with a token) can access

Direct Known Subclasses

Profile

Instance Method Summary collapse

Instance Method Details

#bioString

Returns the user's bio.

Returns:

  • (String)

    the user's bio


19
20
21
# File 'lib/memerator/user.rb', line 19

def bio
  @data['bio']
end

#followersInteger

Returns the amount of followers this user has.

Returns:

  • (Integer)

    the amount of followers this user has


24
25
26
# File 'lib/memerator/user.rb', line 24

def followers
  @data['stats']['followers']
end

#followingInteger

Returns the amount of users this user is following.

Returns:

  • (Integer)

    the amount of users this user is following


29
30
31
# File 'lib/memerator/user.rb', line 29

def following
  @data['stats']['following']
end

#idInteger

Returns the user's ID.

Returns:

  • (Integer)

    the user's ID


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

def id
  @data['id']
end

#joinedTime

Returns the user's join time.

Returns:

  • (Time)

    the user's join time


64
65
66
# File 'lib/memerator/user.rb', line 64

def joined
  Time.parse(@data['joined'])
end

Returns the user's profile link.

Returns:

  • (String)

    the user's profile link


59
60
61
# File 'lib/memerator/user.rb', line 59

def link
  @data['permalink']
end

#memesInteger

Returns the amount of memes this user has.

Returns:

  • (Integer)

    the amount of memes this user has


34
35
36
# File 'lib/memerator/user.rb', line 34

def memes
  @data['stats']['memes']
end

#pro?true, false

Returns the user's pro status.

Returns:

  • (true, false)

    the user's pro status


54
55
56
# File 'lib/memerator/user.rb', line 54

def pro?
  @data['perks']['pro']
end

#staff?true, false

Returns the user's staff member status.

Returns:

  • (true, false)

    the user's staff member status


44
45
46
# File 'lib/memerator/user.rb', line 44

def staff?
  @data['perks']['staff']
end

#translator?true, false

Returns the user's translator status.

Returns:

  • (true, false)

    the user's translator status


49
50
51
# File 'lib/memerator/user.rb', line 49

def translator?
  @data['perks']['translator']
end

#usernameString

Returns the user's username.

Returns:

  • (String)

    the user's username


9
10
11
# File 'lib/memerator/user.rb', line 9

def username
  @data['username']
end

#verified?true, false

Returns the user's verification status.

Returns:

  • (true, false)

    the user's verification status


39
40
41
# File 'lib/memerator/user.rb', line 39

def verified?
  @data['perks']['verified']
end