Class: Raml::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/raml/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, uri_partial) ⇒ Resource

Returns a new instance of Resource.



5
6
7
8
9
10
# File 'lib/raml/resource.rb', line 5

def initialize(parent, uri_partial)
  @parent       = parent
  @uri_partial  = uri_partial
  @http_methods = []
  @resources    = []
end

Instance Attribute Details

#http_methodsObject

Returns the value of attribute http_methods.



3
4
5
# File 'lib/raml/resource.rb', line 3

def http_methods
  @http_methods
end

#parentObject

Returns the value of attribute parent.



3
4
5
# File 'lib/raml/resource.rb', line 3

def parent
  @parent
end

#resourcesObject

Returns the value of attribute resources.



3
4
5
# File 'lib/raml/resource.rb', line 3

def resources
  @resources
end

#uri_partialObject

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

#pathObject



12
13
14
# File 'lib/raml/resource.rb', line 12

def path
  File.join(parent.path, uri_partial)
end

#uriObject



16
17
18
# File 'lib/raml/resource.rb', line 16

def uri
  File.join(parent.uri, uri_partial)
end