Class: RamlParser::Model::Method
- Inherits:
-
Object
- Object
- RamlParser::Model::Method
- Defined in:
- lib/raml_parser/model.rb
Instance Attribute Summary collapse
-
#bodies ⇒ Object
Returns the value of attribute bodies.
-
#description ⇒ Object
Returns the value of attribute description.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#is ⇒ Object
Returns the value of attribute is.
-
#method ⇒ Object
Returns the value of attribute method.
-
#protocols ⇒ Object
Returns the value of attribute protocols.
-
#query_parameters ⇒ Object
Returns the value of attribute query_parameters.
-
#responses ⇒ Object
Returns the value of attribute responses.
-
#secured_by ⇒ Object
Returns the value of attribute secured_by.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(method, description = nil, query_parameters = {}, responses = {}, bodies = {}, headers = {}, is = {}, protocols = [], secured_by = []) ⇒ Method
constructor
A new instance of Method.
Constructor Details
#initialize(method, description = nil, query_parameters = {}, responses = {}, bodies = {}, headers = {}, is = {}, protocols = [], secured_by = []) ⇒ Method
Returns a new instance of Method.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/raml_parser/model.rb', line 58 def initialize(method, description = nil, query_parameters = {}, responses = {}, bodies = {}, headers = {}, is = {}, protocols = [], secured_by = []) @method = method @description = description @query_parameters = query_parameters @responses = responses @bodies = bodies @headers = headers @is = is @protocols = protocols @secured_by = secured_by end |
Instance Attribute Details
#bodies ⇒ Object
Returns the value of attribute bodies.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def bodies @bodies end |
#description ⇒ Object
Returns the value of attribute description.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def description @description end |
#headers ⇒ Object
Returns the value of attribute headers.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def headers @headers end |
#is ⇒ Object
Returns the value of attribute is.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def is @is end |
#method ⇒ Object
Returns the value of attribute method.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def method @method end |
#protocols ⇒ Object
Returns the value of attribute protocols.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def protocols @protocols end |
#query_parameters ⇒ Object
Returns the value of attribute query_parameters.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def query_parameters @query_parameters end |
#responses ⇒ Object
Returns the value of attribute responses.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def responses @responses end |
#secured_by ⇒ Object
Returns the value of attribute secured_by.
56 57 58 |
# File 'lib/raml_parser/model.rb', line 56 def secured_by @secured_by end |
Class Method Details
.merge(a, b) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/raml_parser/model.rb', line 70 def self.merge(a, b) method = Method.new(b.method) method.description = if b.description then b.description else a.description end method.query_parameters = a.query_parameters.merge(b.query_parameters) method.responses = a.responses.merge(b.responses) method.bodies = a.bodies.merge(b.bodies) method.headers = a.headers.merge(b.headers) method.is = a.is.merge(b.is) method.protocols = (a.protocols + b.protocols).uniq method.secured_by = (a.secured_by + b.secured_by).uniq method end |