Class: Raml::Resource

Inherits:
AbstractResource show all
Defined in:
lib/raml/node/resource.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractResource

#base_uri_parameters, #methods, #traits, #type, #uri_parameters

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 inherited from AbstractResource

#merge, #resource_path, #resource_path_name

Methods included from SecuredBy

#_validate_secured_by, #parse_secured_by

Methods included from Validation

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

Methods included from Merge

#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, #initialize, #non_scalar_properties, #scalar_properties

Methods inherited from Node

#initialize

Constructor Details

This class inherits a constructor from Raml::PropertiesNode

Instance Attribute Details

#resourcesHash<String, Raml::Resource> (readonly)

Returns the nested resources, keyed by the resource relative path.

Returns:

  • (Hash<String, Raml::Resource>)

    the nested resources, keyed by the resource relative path.



10
# File 'lib/raml/node/resource.rb', line 10

children_by :resources, :name, Resource

Instance Method Details

#apply_resource_typeObject



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

def apply_resource_type
  super
  resources.values.each(&:apply_resource_type)
end

#apply_traitsObject



19
20
21
22
# File 'lib/raml/node/resource.rb', line 19

def apply_traits
  methods.values.each(&:apply_traits)
  resources.values.each(&:apply_traits)
end