Class: Raml::Resource
- Inherits:
-
Object
- Object
- Raml::Resource
- Defined in:
- lib/raml/resource.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#http_methods ⇒ Object
Returns the value of attribute http_methods.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#resources ⇒ Object
Returns the value of attribute resources.
-
#uri_partial ⇒ Object
Returns the value of attribute uri_partial.
Instance Method Summary collapse
-
#initialize(parent, uri_partial) ⇒ Resource
constructor
A new instance of Resource.
- #path ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(parent, uri_partial) ⇒ Resource
Returns a new instance of Resource.
6 7 8 9 10 11 |
# File 'lib/raml/resource.rb', line 6 def initialize(parent, uri_partial) @parent = parent @uri_partial = uri_partial @http_methods = [] @resources = [] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
3 4 5 |
# File 'lib/raml/resource.rb', line 3 def description @description end |
#display_name ⇒ Object
Returns the value of attribute display_name.
3 4 5 |
# File 'lib/raml/resource.rb', line 3 def display_name @display_name end |
#http_methods ⇒ Object
Returns the value of attribute http_methods.
3 4 5 |
# File 'lib/raml/resource.rb', line 3 def http_methods @http_methods end |
#parent ⇒ Object
Returns the value of attribute parent.
3 4 5 |
# File 'lib/raml/resource.rb', line 3 def parent @parent end |
#resources ⇒ Object
Returns the value of attribute resources.
3 4 5 |
# File 'lib/raml/resource.rb', line 3 def resources @resources end |
#uri_partial ⇒ Object
Returns the value of attribute uri_partial.
3 4 5 |
# File 'lib/raml/resource.rb', line 3 def uri_partial @uri_partial end |
Instance Method Details
#path ⇒ Object
13 14 15 |
# File 'lib/raml/resource.rb', line 13 def path File.join(parent.path, uri_partial) end |
#uri ⇒ Object
17 18 19 |
# File 'lib/raml/resource.rb', line 17 def uri File.join(parent.uri, uri_partial) end |