Class: RedditApi::User

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ User

Returns a new instance of User.



7
8
9
# File 'lib/reddit_api/user.rb', line 7

def initialize(args = {})
  @username = args.fetch("username", nil)
end

Instance Attribute Details

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#to_hObject



11
12
13
# File 'lib/reddit_api/user.rb', line 11

def to_h
  { username: username }
end