Class: Rubapi::Request
- Inherits:
-
Object
- Object
- Rubapi::Request
- Defined in:
- lib/rubapi/request.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#pagination ⇒ Object
Returns the value of attribute pagination.
-
#params ⇒ Object
Returns the value of attribute params.
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
- #default_pagination ⇒ Object
-
#initialize ⇒ Request
constructor
A new instance of Request.
- #parse(param_string) ⇒ Object
Constructor Details
#initialize ⇒ Request
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
#errors ⇒ Object
Returns the value of attribute errors.
3 4 5 |
# File 'lib/rubapi/request.rb', line 3 def errors @errors end |
#pagination ⇒ Object
Returns the value of attribute pagination.
3 4 5 |
# File 'lib/rubapi/request.rb', line 3 def pagination @pagination end |
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/rubapi/request.rb', line 3 def params @params end |
#route ⇒ Object
Returns the value of attribute route.
3 4 5 |
# File 'lib/rubapi/request.rb', line 3 def route @route end |
Instance Method Details
#default_pagination ⇒ Object
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 |