Class: Case::Host
- Inherits:
-
Object
- Object
- Case::Host
- Defined in:
- lib/teuton/case/host.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #get(id = nil) ⇒ Object
-
#initialize(config) ⇒ Host
constructor
A new instance of Host.
- #to_s ⇒ Object
Constructor Details
#initialize(config) ⇒ Host
Returns a new instance of Host.
11 12 13 |
# File 'lib/teuton/case/host.rb', line 11 def initialize(config) @config = config end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/teuton/case/host.rb', line 3 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
4 5 6 |
# File 'lib/teuton/case/host.rb', line 4 def ip @ip end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
6 7 8 |
# File 'lib/teuton/case/host.rb', line 6 def password @password end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/teuton/case/host.rb', line 7 def port @port end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
8 9 10 |
# File 'lib/teuton/case/host.rb', line 8 def protocol @protocol end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
9 10 11 |
# File 'lib/teuton/case/host.rb', line 9 def route @route end |
#username ⇒ Object (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_s ⇒ Object
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 |