Class: Rambo::RamlModels::Body
- Inherits:
-
Object
- Object
- Rambo::RamlModels::Body
- Defined in:
- lib/rambo/raml_models/body.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #content_type ⇒ Object
- #example ⇒ Object
-
#initialize(raml) ⇒ Body
constructor
A new instance of Body.
- #schema ⇒ Object
Constructor Details
#initialize(raml) ⇒ Body
9 10 11 |
# File 'lib/rambo/raml_models/body.rb', line 9 def initialize(raml) @body = raml end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'lib/rambo/raml_models/body.rb', line 7 def body @body end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/rambo/raml_models/body.rb', line 7 def type @type end |
Instance Method Details
#content_type ⇒ Object
13 14 15 |
# File 'lib/rambo/raml_models/body.rb', line 13 def content_type body.content_type end |
#example ⇒ Object
17 18 19 |
# File 'lib/rambo/raml_models/body.rb', line 17 def example @example ||= body.example || generate_from_schema || {}.to_json end |
#schema ⇒ Object
21 22 23 |
# File 'lib/rambo/raml_models/body.rb', line 21 def schema @schema ||= body.schema end |