Class: TcServer::Revision

Inherits:
Shared::StateResource show all
Includes:
Shared::Deletable
Defined in:
lib/vas/tc_server/revisions.rb

Overview

A revision of an application

Instance Attribute Summary collapse

Attributes included from Shared::Deletable

#collection

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods included from Shared::Deletable

#delete

Methods inherited from Shared::StateResource

#start, #state, #stop

Constructor Details

#initialize(location, client) ⇒ Revision

Returns a new instance of Revision.



47
48
49
50
51
52
53
# File 'lib/vas/tc_server/revisions.rb', line 47

def initialize(location, client)
  super(location, client)

  @version = details['version']
  @application_location = Util::LinkUtils.get_link_href(details, 'group-application')
  @revision_image_location = Util::LinkUtils.get_link_href(details, 'revision-image')
end

Instance Attribute Details

#versionString (readonly)

Returns the revision’s version.

Returns:

  • (String)

    the revision’s version



44
45
46
# File 'lib/vas/tc_server/revisions.rb', line 44

def version
  @version
end

Instance Method Details

#applicationApplication

Returns the revision’s application.

Returns:



61
62
63
# File 'lib/vas/tc_server/revisions.rb', line 61

def application
  @application ||= Application.new(@application_location, client)
end

#node_revisionsNodeRevision[]

Returns the revision’s node revisions.

Returns:



56
57
58
# File 'lib/vas/tc_server/revisions.rb', line 56

def node_revisions
  @node_revisions ||= create_resources_from_links('node-revision', NodeRevision)
end

#revision_imageRevisionImage

Returns the revision image, if any, that was used to create the revision.

Returns:

  • (RevisionImage)

    the revision image, if any, that was used to create the revision



66
67
68
69
70
71
# File 'lib/vas/tc_server/revisions.rb', line 66

def revision_image
  if @revision_image.nil?
    @revision_image = RevisionImage.new(@revision_image_location, client) unless @revision_image_location.nil?
  end
  @revision_image
end

#to_sString

Returns a string representation of the revision.

Returns:

  • (String)

    a string representation of the revision



74
75
76
# File 'lib/vas/tc_server/revisions.rb', line 74

def to_s
  "#<#{self.class} version='#@version'>"
end