Class: Rambo::RamlModels::Method
- Inherits:
-
Object
- Object
- Rambo::RamlModels::Method
- Defined in:
- lib/rambo/raml_models/method.rb
Instance Attribute Summary collapse
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
- #description ⇒ Object
- #headers ⇒ Object
-
#initialize(raml_method) ⇒ Method
constructor
A new instance of Method.
- #method ⇒ Object
- #request_body ⇒ Object
- #responses ⇒ Object
Constructor Details
#initialize(raml_method) ⇒ Method
Returns a new instance of Method.
6 7 8 |
# File 'lib/rambo/raml_models/method.rb', line 6 def initialize(raml_method) @schema = raml_method end |
Instance Attribute Details
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
4 5 6 |
# File 'lib/rambo/raml_models/method.rb', line 4 def schema @schema end |
Instance Method Details
#description ⇒ Object
18 19 20 |
# File 'lib/rambo/raml_models/method.rb', line 18 def description @description ||= schema.description end |
#headers ⇒ Object
22 23 24 |
# File 'lib/rambo/raml_models/method.rb', line 22 def headers @headers ||= Rambo::RamlModels::Headers.new(schema.headers) if schema.headers end |
#method ⇒ Object
10 11 12 |
# File 'lib/rambo/raml_models/method.rb', line 10 def method schema.method end |
#request_body ⇒ Object
14 15 16 |
# File 'lib/rambo/raml_models/method.rb', line 14 def request_body Rambo::RamlModels::Body.new(schema.bodies.first) if has_request_body? end |
#responses ⇒ Object
26 27 28 |
# File 'lib/rambo/raml_models/method.rb', line 26 def responses @responses ||= schema.responses.map {|resp| Rambo::RamlModels::Response.new(resp) } end |