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]
- BASIC_ATTRIBUTES =
%w[display_name description]
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.
21 22 23 |
# File 'lib/raml/parser/resource.rb', line 21 def initialize(parent) @parent = parent end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
18 19 20 |
# File 'lib/raml/parser/resource.rb', line 18 def attributes @attributes end |
#parent_node ⇒ Object
Returns the value of attribute parent_node.
18 19 20 |
# File 'lib/raml/parser/resource.rb', line 18 def parent_node @parent_node end |
#resource ⇒ Object
Returns the value of attribute resource.
18 19 20 |
# File 'lib/raml/parser/resource.rb', line 18 def resource @resource end |
#trait_names ⇒ Object
Returns the value of attribute trait_names.
18 19 20 |
# File 'lib/raml/parser/resource.rb', line 18 def trait_names @trait_names end |
Instance Method Details
#parse(parent_node, uri_partial, attributes) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/raml/parser/resource.rb', line 25 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 |