Class: UnboundMethod

Inherits:
Object
  • Object
show all
Defined in:
opal/opal/corelib/method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(owner, method, name) ⇒ UnboundMethod

Returns a new instance of UnboundMethod



41
42
43
44
45
# File 'opal/opal/corelib/method.rb', line 41

def initialize(owner, method, name)
  @owner  = owner
  @method = method
  @name   = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name



39
40
41
# File 'opal/opal/corelib/method.rb', line 39

def name
  @name
end

#ownerObject (readonly)

Returns the value of attribute owner



39
40
41
# File 'opal/opal/corelib/method.rb', line 39

def owner
  @owner
end

Instance Method Details

#arityObject



47
48
49
# File 'opal/opal/corelib/method.rb', line 47

def arity
  @method.arity
end

#bind(object) ⇒ Object



51
52
53
# File 'opal/opal/corelib/method.rb', line 51

def bind(object)
  Method.new(object, @method, @name)
end

#inspectObject



55
56
57
# File 'opal/opal/corelib/method.rb', line 55

def inspect
  "#<UnboundMethod: #{@owner.name}##@name>"
end