Class: Raml::Parser::Resource
- Inherits:
-
Object
- Object
- Raml::Parser::Resource
- Extended by:
- Forwardable
- Includes:
- Util
- Defined in:
- lib/raml/parser/resource.rb
Constant Summary collapse
- HTTP_METHODS =
%w[get put post delete]
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#parent_node ⇒ Object
Returns the value of attribute parent_node.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#trait_names ⇒ Object
Returns the value of attribute trait_names.
Instance Method Summary collapse
-
#initialize(parent) ⇒ Resource
constructor
A new instance of Resource.
- #parse(parent_node, uri_partial, attributes) ⇒ Object
Constructor Details
#initialize(parent) ⇒ Resource
Returns a new instance of Resource.
19 20 21 |
# File 'lib/raml/parser/resource.rb', line 19 def initialize(parent) @parent = parent end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
16 17 18 |
# File 'lib/raml/parser/resource.rb', line 16 def attributes @attributes end |
#parent_node ⇒ Object
Returns the value of attribute parent_node.
16 17 18 |
# File 'lib/raml/parser/resource.rb', line 16 def parent_node @parent_node end |
#resource ⇒ Object
Returns the value of attribute resource.
16 17 18 |
# File 'lib/raml/parser/resource.rb', line 16 def resource @resource end |
#trait_names ⇒ Object
Returns the value of attribute trait_names.
16 17 18 |
# File 'lib/raml/parser/resource.rb', line 16 def trait_names @trait_names end |
Instance Method Details
#parse(parent_node, uri_partial, attributes) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/raml/parser/resource.rb', line 23 def parse(parent_node, uri_partial, attributes) @parent_node = parent_node @resource = Raml::Resource.new(@parent_node, uri_partial) @attributes = prepare_attributes(attributes) apply_resource_type parse_attributes resource end |