Class: Edmunds::Api::Request
- Inherits:
-
Object
- Object
- Edmunds::Api::Request
- Defined in:
- lib/edmunds/api/request.rb
Instance Attribute Summary collapse
-
#allowed_parameters ⇒ Object
writeonly
Sets the attribute allowed_parameters.
-
#default_parameters ⇒ Object
writeonly
Sets the attribute default_parameters.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#raw_parameters ⇒ Object
writeonly
Sets the attribute raw_parameters.
-
#required_parameters ⇒ Object
writeonly
Sets the attribute required_parameters.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(path) ⇒ Request
constructor
A new instance of Request.
- #parameters ⇒ Object
Constructor Details
#initialize(path) ⇒ Request
Returns a new instance of Request.
9 10 11 |
# File 'lib/edmunds/api/request.rb', line 9 def initialize(path) @path = path end |
Instance Attribute Details
#allowed_parameters=(value) ⇒ Object (writeonly)
Sets the attribute allowed_parameters
6 7 8 |
# File 'lib/edmunds/api/request.rb', line 6 def allowed_parameters=(value) @allowed_parameters = value end |
#default_parameters=(value) ⇒ Object (writeonly)
Sets the attribute default_parameters
6 7 8 |
# File 'lib/edmunds/api/request.rb', line 6 def default_parameters=(value) @default_parameters = value end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/edmunds/api/request.rb', line 7 def path @path end |
#raw_parameters=(value) ⇒ Object (writeonly)
Sets the attribute raw_parameters
6 7 8 |
# File 'lib/edmunds/api/request.rb', line 6 def raw_parameters=(value) @raw_parameters = value end |
#required_parameters=(value) ⇒ Object (writeonly)
Sets the attribute required_parameters
6 7 8 |
# File 'lib/edmunds/api/request.rb', line 6 def required_parameters=(value) @required_parameters = value end |
Instance Method Details
#get ⇒ Object
17 18 19 |
# File 'lib/edmunds/api/request.rb', line 17 def get Faraday.get(@path, parameters) end |
#parameters ⇒ Object
13 14 15 |
# File 'lib/edmunds/api/request.rb', line 13 def parameters sanitized_parameters end |