Method: Oxidized::Node#initialize
- Defined in:
- lib/oxidized/node.rb
#initialize(opt) ⇒ Node
Returns a new instance of Node.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/oxidized/node.rb', line 11 def initialize opt @name = opt[:name] @ip = IPAddr.new(opt[:ip]).to_s rescue nil @ip ||= Resolv.new.getaddress @name @group = opt[:group] @input = resolve_input opt @output = resolve_output opt @model = resolve_model opt @auth = resolve_auth opt @prompt = resolve_prompt opt @vars = opt[:vars] @stats = Stats.new @retry = 0 # model instance needs to access node instance @model.node = self end |