Class: Echo::User
Instance Method Summary collapse
- #get(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ User
constructor
A new instance of User.
- #update(content, options = {}) ⇒ Object
- #who_am_i(options = {}) ⇒ Object
Constructor Details
Instance Method Details
#get(options = {}) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/echor/user.rb', line 19 def get(={}) [:appkey] = Echo.user raise ArgumentError, "You need to provide a sessionID" unless [:sessionID] raise ArgumentError, "You need to provide a indetifyURL" unless [:identityURL] raise ArgumentError, "You need to setup Echo.user" unless Echo.user self.class.get("/get?#{.to_query}") end |
#update(content, options = {}) ⇒ Object
27 28 29 |
# File 'lib/echor/user.rb', line 27 def update(content, ={}) self.class.post( "https://api.echoenabled.com/v1/users/update", :query => content) end |
#who_am_i(options = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/echor/user.rb', line 12 def who_am_i(={}) [:appkey] = Echo.user raise ArgumentError, "You need to provide a sessionID" unless [:sessionID] raise ArgumentError, "You need to setup Echo.user" unless Echo.user self.class.get("/whoami?#{.to_query}") end |