Class: CortexClient::Http::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/cortex_client/http/agent.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, version:) ⇒ Agent

Returns a new instance of Agent.



6
7
8
9
# File 'lib/cortex_client/http/agent.rb', line 6

def initialize(name:, version:)
  @name = name
  @version = version
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/cortex_client/http/agent.rb', line 4

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



4
5
6
# File 'lib/cortex_client/http/agent.rb', line 4

def version
  @version
end

Class Method Details

.list_to_s(agents) ⇒ Object



11
12
13
# File 'lib/cortex_client/http/agent.rb', line 11

def self.list_to_s(agents)
  agents.collect(&:to_s).join(" ")
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/cortex_client/http/agent.rb', line 15

def to_s
  "#{name}/#{version}".freeze
end