Class: Skewer::StubNode
- Inherits:
-
Object
- Object
- Skewer::StubNode
- Defined in:
- lib/stub_node.rb
Overview
test stub for pretending to be a real node
Instance Attribute Summary collapse
-
#dns_name ⇒ Object
readonly
Returns the value of attribute dns_name.
-
#public_ip_address ⇒ Object
readonly
Returns the value of attribute public_ip_address.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #announce(return_type) ⇒ Object
-
#initialize ⇒ StubNode
constructor
A new instance of StubNode.
- #method_missing(name, *args) ⇒ Object
Constructor Details
#initialize ⇒ StubNode
Returns a new instance of StubNode.
6 7 8 9 10 11 |
# File 'lib/stub_node.rb', line 6 def initialize @dns_name = 'com.doodoo' @public_ip_address = '192.168.0.1' @username = 'imabirdbrain' @debug = false end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/stub_node.rb', line 18 def method_missing(name, *args) require 'ersatz/ssh_result.rb' Skewer.logger.debug "#{self.class}.#{name} called with #{args.join(',')}" if @debug return announce([ErsatzSSHResult.new('foo', 'success', 0)]) if name == :ssh announce true end |
Instance Attribute Details
#dns_name ⇒ Object (readonly)
Returns the value of attribute dns_name.
4 5 6 |
# File 'lib/stub_node.rb', line 4 def dns_name @dns_name end |
#public_ip_address ⇒ Object (readonly)
Returns the value of attribute public_ip_address.
4 5 6 |
# File 'lib/stub_node.rb', line 4 def public_ip_address @public_ip_address end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
4 5 6 |
# File 'lib/stub_node.rb', line 4 def username @username end |