Class: Case::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/teuton/case/host.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Host



11
12
13
# File 'lib/teuton/case/host.rb', line 11

def initialize(config)
  @config = config
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/teuton/case/host.rb', line 3

def id
  @id
end

#ipObject (readonly)

Returns the value of attribute ip.



4
5
6
# File 'lib/teuton/case/host.rb', line 4

def ip
  @ip
end

#passwordObject (readonly)

Returns the value of attribute password.



6
7
8
# File 'lib/teuton/case/host.rb', line 6

def password
  @password
end

#portObject (readonly)

Returns the value of attribute port.



7
8
9
# File 'lib/teuton/case/host.rb', line 7

def port
  @port
end

#protocolObject (readonly)

Returns the value of attribute protocol.



8
9
10
# File 'lib/teuton/case/host.rb', line 8

def protocol
  @protocol
end

#routeObject (readonly)

Returns the value of attribute route.



9
10
11
# File 'lib/teuton/case/host.rb', line 9

def route
  @route
end

#usernameObject (readonly)

Returns the value of attribute username.



5
6
7
# File 'lib/teuton/case/host.rb', line 5

def username
  @username
end

Instance Method Details

#get(id = nil) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/teuton/case/host.rb', line 15

def get(id = nil)
  if id.nil?
    init_default
  else
    init(id)
  end
  self
end

#to_sObject



24
25
26
27
28
29
30
31
# File 'lib/teuton/case/host.rb', line 24

def to_s
  data = {
    id: id,
    ip: ip, username: username, password: password,
    port: port, protocol: protocol, route: route
  }
  data.to_s
end