Class: DocSmoosher::Request
- Defined in:
- lib/doc_smoosher/request.rb
Instance Attribute Summary collapse
-
#call_type ⇒ Object
Returns the value of attribute call_type.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#path ⇒ Object
Returns the value of attribute path.
-
#response ⇒ Object
Returns the value of attribute response.
Attributes inherited from ApiObject
#default, #description, #example, #name, #required, #type
Attributes included from Parameters
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
- #field(params = {}, &block) ⇒ Object
-
#initialize(params = {}, &block) ⇒ Request
constructor
A new instance of Request.
Methods included from Parameters
Constructor Details
#initialize(params = {}, &block) ⇒ Request
Returns a new instance of Request.
5 6 7 8 9 10 |
# File 'lib/doc_smoosher/request.rb', line 5 def initialize(params = {}, &block) # Defaults self.call_type = :get super(params) end |
Instance Attribute Details
#call_type ⇒ Object
Returns the value of attribute call_type.
3 4 5 |
# File 'lib/doc_smoosher/request.rb', line 3 def call_type @call_type end |
#fields ⇒ Object
Returns the value of attribute fields.
3 4 5 |
# File 'lib/doc_smoosher/request.rb', line 3 def fields @fields end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/doc_smoosher/request.rb', line 3 def path @path end |
#response ⇒ Object
Returns the value of attribute response.
3 4 5 |
# File 'lib/doc_smoosher/request.rb', line 3 def response @response end |
Instance Method Details
#as_json(options = {}) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/doc_smoosher/request.rb', line 27 def as_json(={}) super.merge( { :fields => fields.map(&:as_json), :parameters => parameters.map(&:as_json) } ) end |