Class: ApiSketch::Model::Parameters
- Defined in:
- lib/api_sketch/model/parameters.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#body_container_type ⇒ Object
Returns the value of attribute body_container_type.
-
#query ⇒ Object
Returns the value of attribute query.
-
#query_container_type ⇒ Object
Returns the value of attribute query_container_type.
Attributes inherited from Base
Instance Method Summary collapse
- #as_full_names ⇒ Object
-
#initialize(attributes = {}) ⇒ Parameters
constructor
A new instance of Parameters.
- #wrapped_body ⇒ Object
- #wrapped_query ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Parameters
Returns a new instance of Parameters.
4 5 6 7 8 |
# File 'lib/api_sketch/model/parameters.rb', line 4 def initialize(attributes = {}) super(attributes) self.query ||= [] self.body ||= [] end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
2 3 4 |
# File 'lib/api_sketch/model/parameters.rb', line 2 def body @body end |
#body_container_type ⇒ Object
Returns the value of attribute body_container_type.
2 3 4 |
# File 'lib/api_sketch/model/parameters.rb', line 2 def body_container_type @body_container_type end |
#query ⇒ Object
Returns the value of attribute query.
2 3 4 |
# File 'lib/api_sketch/model/parameters.rb', line 2 def query @query end |
#query_container_type ⇒ Object
Returns the value of attribute query_container_type.
2 3 4 |
# File 'lib/api_sketch/model/parameters.rb', line 2 def query_container_type @query_container_type end |
Instance Method Details
#as_full_names ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/api_sketch/model/parameters.rb', line 18 def as_full_names fullname_params = self.class.new [:query, :body].each do |param_location| new_params = [] self.send(param_location).each do |param| if param.data_type == :document full_names_for(param, param.name, new_params) else new_params << param end end fullname_params.send("#{param_location}=", new_params) end fullname_params end |