Class: Convore::Account
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Attributes inherited from Base
Instance Method Summary collapse
-
#get_members_online ⇒ Object
Get members online now.
-
#get_mentions ⇒ Object
Get the users mentions.
-
#initialize(username, password) ⇒ Account
constructor
A new instance of Account.
-
#mark_all_read ⇒ Object
Mark all messages as read.
-
#verified? ⇒ Boolean
Use this method to check if the user is properly logged in (also get user id).
Methods inherited from Base
api, find, from_json, get_class, #method_missing
Constructor Details
#initialize(username, password) ⇒ Account
Returns a new instance of Account.
7 8 9 10 |
# File 'lib/convore/account.rb', line 7 def initialize(username, password) @username = username @password = password end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Convore::Base
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/convore/account.rb', line 5 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/convore/account.rb', line 5 def username @username end |
Instance Method Details
#get_members_online ⇒ Object
Get members online now
23 24 25 |
# File 'lib/convore/account.rb', line 23 def get_members_online RestClient.get "https://#{@username}:#{@password}@convore.com/api/account/online.json" end |
#get_mentions ⇒ Object
Get the users mentions
28 29 30 |
# File 'lib/convore/account.rb', line 28 def get_mentions RestClient.get "https://#{@username}:#{@password}@convore.com/api/account/online.json" end |
#mark_all_read ⇒ Object
Mark all messages as read
18 19 20 |
# File 'lib/convore/account.rb', line 18 def mark_all_read RestClient.post "https://#{@username}:#{@password}@convore.com/api/account/mark_read.json", {} end |
#verified? ⇒ Boolean
Use this method to check if the user is properly logged in (also get user id)
13 14 15 |
# File 'lib/convore/account.rb', line 13 def verified? RestClient.get "https://#{@username}:#{@password}@convore.com/api/account/verify.json" end |