Class: Arachni::RPC::Client::Instance::OptsMapper

Inherits:
RemoteObjectMapper
  • Object
show all
Defined in:
lib/arachni/rpc/client/instance.rb

Overview

Used to make remote option attributes look like setter methods

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/arachni/rpc/client/instance.rb', line 43

def method_missing( sym, *args, &block )
    return super( sym, *args, &block ) if sym == :set

    call  = "#{@remote}.#{sym.to_s}"

    if !args.empty? && !sym.to_s.end_with?( '=' ) &&
        Options.instance.methods.include?( "#{sym}=".to_sym  )
        call += '='
    end

    @server.call( call, *args, &block )
end