Class: TcServer::Revision
- Inherits:
-
Shared::StateResource
- Object
- Shared::Resource
- Shared::StateResource
- TcServer::Revision
- Includes:
- Shared::Deletable
- Defined in:
- lib/vas/tc_server/revisions.rb
Overview
A revision of an application
Instance Attribute Summary collapse
-
#version ⇒ String
readonly
The revision’s version.
Attributes included from Shared::Deletable
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#application ⇒ Application
The revision’s application.
-
#initialize(location, client) ⇒ Revision
constructor
A new instance of Revision.
-
#node_revisions ⇒ NodeRevision[]
The revision’s node revisions.
-
#revision_image ⇒ RevisionImage
The revision image, if any, that was used to create the revision.
-
#to_s ⇒ String
A string representation of the revision.
Methods included from Shared::Deletable
Methods inherited from Shared::StateResource
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
#version ⇒ String (readonly)
Returns the revision’s version.
44 45 46 |
# File 'lib/vas/tc_server/revisions.rb', line 44 def version @version end |
Instance Method Details
#application ⇒ Application
Returns the revision’s application.
61 62 63 |
# File 'lib/vas/tc_server/revisions.rb', line 61 def application @application ||= Application.new(@application_location, client) end |
#node_revisions ⇒ NodeRevision[]
Returns the revision’s node revisions.
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_image ⇒ RevisionImage
Returns 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_s ⇒ String
Returns 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 |