Module: Fleakr::Support::Request

Included in:
Api::AuthenticationRequest, Api::MethodRequest
Defined in:
lib/fleakr/support/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#parametersObject (readonly)

Returns the value of attribute parameters.



5
6
7
# File 'lib/fleakr/support/request.rb', line 5

def parameters
  @parameters
end

Instance Method Details

#endpoint_uriObject



14
15
16
17
18
# File 'lib/fleakr/support/request.rb', line 14

def endpoint_uri
  uri = URI.parse(endpoint_url)
  uri.query = self.parameters.to_query
  uri
end

#initialize(additional_parameters = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/fleakr/support/request.rb', line 7

def initialize(additional_parameters = {})
  authenticate = additional_parameters.delete(:authenticate?)
  authenticate = authenticate.nil? ? true : authenticate
  
  @parameters = Fleakr::Api::ParameterList.new(additional_parameters, authenticate)
end