Class: Reddit::Services::User
- Inherits:
-
Object
- Object
- Reddit::Services::User
- Defined in:
- lib/reddit/services/user.rb
Overview
Everything else in the services module is created at runtime through the “service.rb” generator
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#name ⇒ Object
Returns the value of attribute name.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(username, password, client_id, secret, user_agent_title, options = {}) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(username, password, client_id, secret, user_agent_title, options = {}) ⇒ User
Returns a new instance of User.
12 13 14 15 16 17 18 19 20 |
# File 'lib/reddit/services/user.rb', line 12 def initialize(username, password, client_id, secret, user_agent_title, = {}) raise "user_agent_title must be set, please follow the reddit API rules" if user_agent_title == nil @name = username @connection = Reddit::Internal::Connection.new(username, password, client_id, secret, user_agent_title, ) @connection.sign_in() @token = @connection.token end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
10 11 12 |
# File 'lib/reddit/services/user.rb', line 10 def connection @connection end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/reddit/services/user.rb', line 7 def name @name end |
#token ⇒ Object
Returns the value of attribute token.
8 9 10 |
# File 'lib/reddit/services/user.rb', line 8 def token @token end |