Module: Pervasives

Defined in:
lib/pervasives.rb,
lib/pervasives-1.1.0.rb

Defined Under Namespace

Classes: Proxy

Constant Summary collapse

VERSION =
"1.1.0"
Methods =
Hash.new{|h,k| h[k] = {}}

Class Method Summary collapse

Class Method Details

.call(o, m, *a, &b) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pervasives.rb', line 13

def self.call o, m, *a, &b
  list = 
    case o
      when Class then [Class, Module, Object]
      when Module then [Module, Object]
      when Object then [Object]
    end
  type = list.detect{|type| Methods[type]["#{ m }"]} 
  m = Methods[type]["#{ m }"]
  ( m ).bind( o ).call( *a, &b )
end

.new(*a, &b) ⇒ Object



43
44
45
# File 'lib/pervasives.rb', line 43

def self.new *a, &b
  Proxy.new *a, &b
end

.versionObject



3
# File 'lib/pervasives.rb', line 3

def self.version() VERSION end