Class: PortfolioManager::REST::Request
- Inherits:
-
Object
- Object
- PortfolioManager::REST::Request
- Defined in:
- lib/portfolio_manager/rest/request.rb
Overview
Manage HTTP requests
Constant Summary collapse
- BASE_URL =
'https://portfoliomanager.energystar.gov'- LIVE_PATH =
'/ws'- TEST_PATH =
'/wstest'- CONTENT_TYPE =
'application/xml'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#options ⇒ Object
Returns the value of attribute options.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#request_method ⇒ Object
readonly
Returns the value of attribute request_method.
Instance Method Summary collapse
-
#initialize(client, request_method, path, options) ⇒ Request
constructor
A new instance of Request.
- #perform ⇒ Hash
Constructor Details
#initialize(client, request_method, path, options) ⇒ Request
Returns a new instance of Request.
21 22 23 24 25 26 27 28 29 |
# File 'lib/portfolio_manager/rest/request.rb', line 21 def initialize(client, request_method, path, ) @client = client @path = api_environment + path = @request_method = request_method @conn = Hurley::Client.new(BASE_URL) @parser = Nori.new setup_client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
14 15 16 |
# File 'lib/portfolio_manager/rest/request.rb', line 14 def client @client end |
#options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'lib/portfolio_manager/rest/request.rb', line 15 def end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
14 15 16 |
# File 'lib/portfolio_manager/rest/request.rb', line 14 def parser @parser end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
14 15 16 |
# File 'lib/portfolio_manager/rest/request.rb', line 14 def path @path end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
14 15 16 |
# File 'lib/portfolio_manager/rest/request.rb', line 14 def request_method @request_method end |
Instance Method Details
#perform ⇒ Hash
33 34 35 |
# File 'lib/portfolio_manager/rest/request.rb', line 33 def perform parser.parse(response_body) end |