Class: RestApplicationTemplate

Inherits:
OpenShift::Model
  • Object
show all
Defined in:
app/models/rest_application_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template, url, nolinks = false) ⇒ RestApplicationTemplate

Returns a new instance of RestApplicationTemplate.



4
5
6
7
8
9
10
11
12
13
14
# File 'app/models/rest_application_template.rb', line 4

def initialize(template, url, nolinks=false)
  @uuid, @display_name, @descriptor_yaml, @git_url, @tags, @gear_cost, @metadata =
   template.uuid, template.display_name, template.descriptor_yaml, template.git_url, template.tags,
      template.gear_cost, template.
      
  self.links = {
    "GET_TEMPLATE" => Link.new("Get specific template", "GET", URI::join(url, "application_templates/#{@uuid}")),
    "LIST_TEMPLATES" => Link.new("Get specific template", "GET", URI::join(url, "application_templates")),
    "LIST_TEMPLATES_BY_TAG" => Link.new("Get specific template", "GET", URI::join(url, "application_templates/TAG"))
  } unless nolinks
end

Instance Attribute Details

#descriptor_yamlObject

Returns the value of attribute descriptor_yaml.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def descriptor_yaml
  @descriptor_yaml
end

#display_nameObject

Returns the value of attribute display_name.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def display_name
  @display_name
end

#gear_costObject

Returns the value of attribute gear_cost.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def gear_cost
  @gear_cost
end

#git_urlObject

Returns the value of attribute git_url.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def git_url
  @git_url
end

Returns the value of attribute links.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def links
  @links
end

#metadataObject

Returns the value of attribute metadata.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def 
  @metadata
end

#tagsObject

Returns the value of attribute tags.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def tags
  @tags
end

#uuidObject

Returns the value of attribute uuid.



2
3
4
# File 'app/models/rest_application_template.rb', line 2

def uuid
  @uuid
end

Instance Method Details

#to_xml(options = {}) ⇒ Object



16
17
18
19
# File 'app/models/rest_application_template.rb', line 16

def to_xml(options={})
  options[:tag_name] = "template"
  super(options)
end