Class: TcServer::Revision

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

Overview

A revision of an Application

Instance Attribute Summary collapse

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Methods inherited from Shared::StateResource

#start, #state, #stop

Constructor Details

#initialize(location, client) ⇒ Revision

:nodoc:



43
44
45
46
47
48
49
# File 'lib/vas/tc_server/revisions.rb', line 43

def initialize(location, client) #:nodoc:
  super(location, client)
  
  @version = details['version']
  @revision_image_location = Util::LinkUtils.get_link_href(details, 'revision-image')
  @application = Application.new(Util::LinkUtils.get_link_href(details, 'group-application'), client)
end

Instance Attribute Details

#applicationObject (readonly)

The Revision’s application



41
42
43
# File 'lib/vas/tc_server/revisions.rb', line 41

def application
  @application
end

#versionObject (readonly)

The Revision’s version



38
39
40
# File 'lib/vas/tc_server/revisions.rb', line 38

def version
  @version
end

Instance Method Details

#node_revisionsObject

An array of the revision’s individual node revisions



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

def node_revisions
  node_revisions = []
  Util::LinkUtils.get_link_hrefs(client.get(location), 'node-revision').each {
      |node_revision_location| node_revisions << NodeRevision.new(node_revision_location, client)}
  node_revisions
end

#revision_imageObject

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



52
53
54
55
56
# File 'lib/vas/tc_server/revisions.rb', line 52

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

#to_sObject

:nodoc:



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

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