Class: SimpleRequest
- Inherits:
-
Object
- Object
- SimpleRequest
- Defined in:
- lib/simple_request.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #code ⇒ Object
- #csv(path = nil) ⇒ Object
-
#initialize(options = {}) ⇒ SimpleRequest
constructor
A new instance of SimpleRequest.
Constructor Details
#initialize(options = {}) ⇒ SimpleRequest
Returns a new instance of SimpleRequest.
11 12 13 14 |
# File 'lib/simple_request.rb', line 11 def initialize( = {}) @options = .symbolize_keys! validate end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/simple_request.rb', line 9 def @options end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/simple_request.rb', line 9 def response @response end |
Instance Method Details
#code ⇒ Object
65 66 67 |
# File 'lib/simple_request.rb', line 65 def code response&.code end |
#csv(path = nil) ⇒ Object
61 62 63 |
# File 'lib/simple_request.rb', line 61 def csv(path = nil) SimpleHelper::ResponseParser.perform(body_response, 'csv', path) end |