Class: Rhapsody::MembersController
- Inherits:
-
Object
- Object
- Rhapsody::MembersController
- Defined in:
- lib/rhapsody/controllers/members_controller.rb
Constant Summary collapse
- PARENT_PATH =
'/v1/me'
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#json_response ⇒ Object
Returns the value of attribute json_response.
-
#path ⇒ Object
Returns the value of attribute path.
-
#raw_reponse ⇒ Object
Returns the value of attribute raw_reponse.
-
#response_status ⇒ Object
Returns the value of attribute response_status.
Instance Method Summary collapse
-
#account ⇒ Object
/me/account.
-
#initialize(options) ⇒ MembersController
constructor
A new instance of MembersController.
Constructor Details
#initialize(options) ⇒ MembersController
Returns a new instance of MembersController.
10 11 12 |
# File 'lib/rhapsody/controllers/members_controller.rb', line 10 def initialize() @access_token = [:access_token] end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
2 3 4 |
# File 'lib/rhapsody/controllers/members_controller.rb', line 2 def access_token @access_token end |
#json_response ⇒ Object
Returns the value of attribute json_response.
2 3 4 |
# File 'lib/rhapsody/controllers/members_controller.rb', line 2 def json_response @json_response end |
#path ⇒ Object
Returns the value of attribute path.
2 3 4 |
# File 'lib/rhapsody/controllers/members_controller.rb', line 2 def path @path end |
#raw_reponse ⇒ Object
Returns the value of attribute raw_reponse.
2 3 4 |
# File 'lib/rhapsody/controllers/members_controller.rb', line 2 def raw_reponse @raw_reponse end |
#response_status ⇒ Object
Returns the value of attribute response_status.
2 3 4 |
# File 'lib/rhapsody/controllers/members_controller.rb', line 2 def response_status @response_status end |
Instance Method Details
#account ⇒ Object
/me/account
15 16 17 18 19 20 21 22 |
# File 'lib/rhapsody/controllers/members_controller.rb', line 15 def account @path = PARENT_PATH + '/account' connection = Rhapsody::FaradayConnection.(access_token) @raw_response = connection.get(@path) @json_response = JSON.parse(@raw_response.env[:body]) @response_status = @raw_response.env[:status] member = Rhapsody::Member.new(@json_response) end |