Class: UnboundMethod
- Inherits:
-
Object
- Object
- UnboundMethod
- Defined in:
- opal/opal/corelib/method.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
Instance Method Summary collapse
- #arity ⇒ Object
- #bind(object) ⇒ Object
-
#initialize(owner, method, name) ⇒ UnboundMethod
constructor
A new instance of UnboundMethod.
- #inspect ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name
39 40 41 |
# File 'opal/opal/corelib/method.rb', line 39 def name @name end |
#owner ⇒ Object (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
#arity ⇒ Object
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 |
#inspect ⇒ Object
55 56 57 |
# File 'opal/opal/corelib/method.rb', line 55 def inspect "#<UnboundMethod: #{@owner.name}##@name>" end |