Class: Raml::Response

Inherits:
PropertiesNode show all
Includes:
Bodies, Documentable, Global, Headers, Merge, Parent, Validation
Defined in:
lib/raml/node/response.rb

Instance Attribute Summary

Attributes included from Headers

#headers

Attributes included from Bodies

#bodies

Attributes included from Parent

#children

Attributes included from Documentable

#description, #display_name

Attributes inherited from PropertiesNode

#optional

Attributes inherited from Node

#name, #parent

Instance Method Summary collapse

Methods included from Validation

#classes_to_s, #validate_array, #validate_hash, #validate_property, #validate_string

Methods included from Merge

#merge_properties

Methods included from Global

#default_media_type, #resource_type_declarations, #schema_declarations, #security_scheme_declarations, #trait_declarations

Methods inherited from PropertiesNode

#_regexp_property, #non_scalar_properties, #scalar_properties

Constructor Details

#initialize(name, properties, parent) ⇒ Response

Returns a new instance of Response.



13
14
15
16
# File 'lib/raml/node/response.rb', line 13

def initialize(name, properties, parent)
  super
  @name = name.to_i
end

Instance Method Details

#merge(other) ⇒ Object

Raises:



19
20
21
22
23
24
25
26
27
28
# File 'lib/raml/node/response.rb', line 19

def merge(other)
  raise MergeError, "Response status codes don't match." if name != other.name

  super

  merge_properties other, :headers
  merge_properties other, :bodies

  self
end