Class: Rambo::RamlModels::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/rambo/raml_models/body.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/rambo/raml_models/body.rb', line 7

def body
  @body
end

#typeObject (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_typeObject



13
14
15
# File 'lib/rambo/raml_models/body.rb', line 13

def content_type
  body.content_type
end

#exampleObject



17
18
19
# File 'lib/rambo/raml_models/body.rb', line 17

def example
  @example ||= body.example || generate_from_schema || {}.to_json
end

#schemaObject



21
22
23
# File 'lib/rambo/raml_models/body.rb', line 21

def schema
  @schema ||= body.schema
end