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.



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

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



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

def display_name
  @display_name
end

#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



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

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

#uriObject



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

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