Class: TcServer::Application

Inherits:
Shared::Resource show all
Defined in:
lib/vas/tc_server/applications.rb

Overview

An application

Instance Attribute Summary collapse

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client) ⇒ Application

Returns a new instance of Application.



66
67
68
69
70
71
72
73
74
75
# File 'lib/vas/tc_server/applications.rb', line 66

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

  @revisions = Revisions.new(Util::LinkUtils.get_link_href(details, "group-revisions"), client)
  @context_path = details["context-path"]
  @name = details["name"]
  @service = details["service"]
  @host = details["host"]
  @instance = Instance.new(Util::LinkUtils.get_link_href(details, "group-instance"), client)
end

Instance Attribute Details

#context_pathString (readonly)

Returns the application’s context path.

Returns:

  • (String)

    the application’s context path



48
49
50
# File 'lib/vas/tc_server/applications.rb', line 48

def context_path
  @context_path
end

#hostString (readonly)

Returns the host the application will deploy its revisions to.

Returns:

  • (String)

    the host the application will deploy its revisions to



57
58
59
# File 'lib/vas/tc_server/applications.rb', line 57

def host
  @host
end

#instanceInstance (readonly)

Returns the instance that contains the application.

Returns:

  • (Instance)

    the instance that contains the application



63
64
65
# File 'lib/vas/tc_server/applications.rb', line 63

def instance
  @instance
end

#nameString (readonly)

Returns the application’s name.

Returns:

  • (String)

    the application’s name



51
52
53
# File 'lib/vas/tc_server/applications.rb', line 51

def name
  @name
end

#revisionsRevisions (readonly)

Returns the application’s revisions.

Returns:

  • (Revisions)

    the application’s revisions



60
61
62
# File 'lib/vas/tc_server/applications.rb', line 60

def revisions
  @revisions
end

#serviceString (readonly)

Returns the service the application will deploy its revisions to.

Returns:

  • (String)

    the service the application will deploy its revisions to



54
55
56
# File 'lib/vas/tc_server/applications.rb', line 54

def service
  @service
end

Instance Method Details

#node_applicationsNodeApplication[]

Returns the application’s individual node applications.

Returns:



78
79
80
81
82
83
# File 'lib/vas/tc_server/applications.rb', line 78

def node_applications
  node_applications = []
  Util::LinkUtils.get_link_hrefs(client.get(location), 'node-application').each {
      |node_application_location| node_applications << NodeApplication.new(node_application_location, client)}
  node_applications
end

#to_sString

Returns a string representation of the application.

Returns:

  • (String)

    a string representation of the application



86
87
88
# File 'lib/vas/tc_server/applications.rb', line 86

def to_s
  "#<#{self.class} name='#@name' context_path='#@context_path' service='#@service' host='#@host'>"
end