Class: Rubapi::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/rubapi/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRequest

Returns a new instance of Request.



8
9
10
11
# File 'lib/rubapi/request.rb', line 8

def initialize
  self.params = {}
  self.pagination = default_pagination
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/rubapi/request.rb', line 3

def errors
  @errors
end

#paginationObject

Returns the value of attribute pagination.



3
4
5
# File 'lib/rubapi/request.rb', line 3

def pagination
  @pagination
end

#paramsObject

Returns the value of attribute params.



3
4
5
# File 'lib/rubapi/request.rb', line 3

def params
  @params
end

#routeObject

Returns the value of attribute route.



3
4
5
# File 'lib/rubapi/request.rb', line 3

def route
  @route
end

Instance Method Details

#default_paginationObject



17
18
19
20
21
# File 'lib/rubapi/request.rb', line 17

def default_pagination
  {
    per_page: 10
  }
end

#parse(param_string) ⇒ Object



13
14
15
# File 'lib/rubapi/request.rb', line 13

def parse(param_string)
  self.params = self.params.merge(Rack::Utils.parse_nested_query(param_string))
end