Class: Netconf::RPC::Executor

Inherits:
Object
  • Object
show all
Includes:
Standard
Defined in:
lib/net/netconf/rpc.rb

Overview

module: Builder

Instance Method Summary collapse

Methods included from Standard

#commit, #delete_config, #edit_config, #get_config, #lock, #unlock, #validate

Constructor Details

#initialize(trans, os_type) ⇒ Executor

Returns a new instance of Executor.


53
54
55
56
57
58
59
60
# File 'lib/net/netconf/rpc.rb', line 53

def initialize(trans, os_type)
  @trans = trans
  begin
    extend Netconf::RPC.const_get(os_type)
  rescue NameError
    # no extensions available ...
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, params = nil, attrs = nil) ⇒ Object


62
63
64
# File 'lib/net/netconf/rpc.rb', line 62

def method_missing(method, params = nil, attrs = nil)
  @trans.rpc_exec(Netconf::RPC::Builder.send(method, params, attrs))
end