Class: Slot

Inherits:
Object
  • Object
show all
Defined in:
lib/galaxy.rb

Overview

Slot Information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, url, binary, config, status) ⇒ Slot

Returns a new instance of Slot.



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/galaxy.rb', line 20

def initialize(id, name, url, binary, config, status)
  @id = id
  @name = name
  @url = url
  @binary = binary
  @config = config
  @status = status
  uri = URI.parse(url)
  @host = uri.host
  @ip = IPSocket::getaddress(host)
end

Instance Attribute Details

#binaryObject (readonly)

Returns the value of attribute binary.



18
19
20
# File 'lib/galaxy.rb', line 18

def binary
  @binary
end

#configObject (readonly)

Returns the value of attribute config.



18
19
20
# File 'lib/galaxy.rb', line 18

def config
  @config
end

#hostObject (readonly)

Returns the value of attribute host.



18
19
20
# File 'lib/galaxy.rb', line 18

def host
  @host
end

#idObject (readonly)

Returns the value of attribute id.



18
19
20
# File 'lib/galaxy.rb', line 18

def id
  @id
end

#ipObject (readonly)

Returns the value of attribute ip.



18
19
20
# File 'lib/galaxy.rb', line 18

def ip
  @ip
end

#nameObject (readonly)

Returns the value of attribute name.



18
19
20
# File 'lib/galaxy.rb', line 18

def name
  @name
end

#statusObject (readonly)

Returns the value of attribute status.



18
19
20
# File 'lib/galaxy.rb', line 18

def status
  @status
end

#urlObject (readonly)

Returns the value of attribute url.



18
19
20
# File 'lib/galaxy.rb', line 18

def url
  @url
end

Instance Method Details



32
33
34
# File 'lib/galaxy.rb', line 32

def print_col
  puts "#{id}\t#{host}\t#{name}\t#{status}\t#{binary}\t#{config}"
end