Module: Pervasives

Defined in:
lib/main/pervasives.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/main/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/main/pervasives.rb', line 43

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

.versionObject



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

def self.version() VERSION end