Class: Gaptool::Host
- Inherits:
-
SSHKit::Host
- Object
- SSHKit::Host
- Gaptool::Host
- Defined in:
- lib/gaptool_client/host.rb
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Instance Method Summary collapse
- #[](attr) ⇒ Object
- #handler ⇒ Object
-
#initialize(node) ⇒ Host
constructor
A new instance of Host.
- #method_missing(attr, *args, &_block) ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(node) ⇒ Host
Returns a new instance of Host.
26 27 28 29 |
# File 'lib/gaptool_client/host.rb', line 26 def initialize(node) super(node['hostname']) @info = node end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(attr, *args, &_block) ⇒ Object
31 32 33 |
# File 'lib/gaptool_client/host.rb', line 31 def method_missing(attr, *args, &_block) @info[attr] || super end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
24 25 26 |
# File 'lib/gaptool_client/host.rb', line 24 def info @info end |
Instance Method Details
#[](attr) ⇒ Object
35 36 37 |
# File 'lib/gaptool_client/host.rb', line 35 def [](attr) @info[attr] end |
#handler ⇒ Object
43 44 45 |
# File 'lib/gaptool_client/host.rb', line 43 def handler InteractionHandler.new(name) end |