Class: TcServer::Revision
- Inherits:
-
Shared::StateResource
- Object
- Shared::Resource
- Shared::StateResource
- TcServer::Revision
- Defined in:
- lib/vas/tc_server/revisions.rb
Overview
A revision of an application
Instance Attribute Summary collapse
-
#application ⇒ Application
readonly
The revision’s application.
-
#revision_image ⇒ RevisionImage
readonly
The revision image, if any, that was used to create the revision.
-
#version ⇒ String
readonly
The revision’s version.
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#initialize(location, client) ⇒ Revision
constructor
A new instance of Revision.
-
#node_revisions ⇒ NodeRevision[]
The revision’s node revisions.
-
#to_s ⇒ String
A string representation of the revision.
Methods inherited from Shared::StateResource
Constructor Details
#initialize(location, client) ⇒ Revision
Returns a new instance of Revision.
51 52 53 54 55 56 57 58 59 |
# File 'lib/vas/tc_server/revisions.rb', line 51 def initialize(location, client) super(location, client) @version = details['version'] @application = Application.new(Util::LinkUtils.get_link_href(details, 'group-application'), client) revision_image_location = Util::LinkUtils.get_link_href(details, 'revision-image') @revision_image = RevisionImage.new(revision_image_location, client) unless revision_image_location.nil? end |
Instance Attribute Details
#application ⇒ Application (readonly)
Returns the revision’s application.
45 46 47 |
# File 'lib/vas/tc_server/revisions.rb', line 45 def application @application end |
#revision_image ⇒ RevisionImage (readonly)
Returns the revision image, if any, that was used to create the revision.
48 49 50 |
# File 'lib/vas/tc_server/revisions.rb', line 48 def revision_image @revision_image end |
#version ⇒ String (readonly)
Returns the revision’s version.
42 43 44 |
# File 'lib/vas/tc_server/revisions.rb', line 42 def version @version end |
Instance Method Details
#node_revisions ⇒ NodeRevision[]
Returns the revision’s node revisions.
62 63 64 65 66 67 |
# File 'lib/vas/tc_server/revisions.rb', line 62 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 |
#to_s ⇒ String
Returns a string representation of the revision.
70 71 72 |
# File 'lib/vas/tc_server/revisions.rb', line 70 def to_s "#<#{self.class} version='#@version'>" end |