Class: ApontadorOauth2::User
- Inherits:
-
Object
- Object
- ApontadorOauth2::User
- Defined in:
- lib/apontador_oauth2/user.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ User
constructor
A new instance of User.
- #register_user_in_apontador(options) ⇒ Object
- #request(options) ⇒ Object
- #user_information ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ User
Returns a new instance of User.
4 5 6 |
# File 'lib/apontador_oauth2/user.rb', line 4 def initialize(={}) = .merge!({:url => "https://api.apontador.com.br/v2/"}) end |
Instance Method Details
#register_user_in_apontador(options) ⇒ Object
13 14 15 16 |
# File 'lib/apontador_oauth2/user.rb', line 13 def register_user_in_apontador() res = request( {:path => "users", :user => }.merge()) JSON.parse(res.body) unless res.status == 201 end |
#request(options) ⇒ Object
18 19 20 |
# File 'lib/apontador_oauth2/user.rb', line 18 def request() Request.send() end |
#user_information ⇒ Object
8 9 10 11 |
# File 'lib/apontador_oauth2/user.rb', line 8 def user_information response = request({:path => "users/me"}.merge!()) json(response.body) end |