module PortfolioManager::REST::Utils

Utilities used throughout REST Client

Private Instance Methods

perform_get_request(path, options = {}) click to toggle source

@param [String] path @param [Hash] options

# File lib/portfolio_manager/rest/utils.rb, line 13
def perform_get_request(path, options = {})
  perform_request(:get, path, options)
end
perform_post_request(path, options = {}) click to toggle source

@param [String] path @param [Hash] options

# File lib/portfolio_manager/rest/utils.rb, line 20
def perform_post_request(path, options = {})
  perform_request(:post, path, options)
end
perform_request(request_method, path, options = {}) click to toggle source

@param [Symbol, String] request_method @param [String] path @param [Hash] options

# File lib/portfolio_manager/rest/utils.rb, line 28
def perform_request(request_method, path, options = {})
  PortfolioManager::REST::Request.new(
    self,
    request_method,
    path,
    options
  ).perform
end
request_response_xml(action, note) click to toggle source
# File lib/portfolio_manager/rest/utils.rb, line 37
def request_response_xml(action, note)
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.sharingResponse {
      xml.action action
      xml.note note
    }
  end.to_xml
end