Class: MethodObject::PotentialDelegator

Inherits:
Struct
  • Object
show all
Defined in:
lib/method_object.rb

Overview

Represents a possible match of the form:

some_method => my_attribute.some_method

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute



97
98
99
# File 'lib/method_object.rb', line 97

def attribute
  @attribute
end

#delegated_methodObject Also known as: method_to_call_on_delegate

Returns the value of attribute delegated_method



97
98
99
# File 'lib/method_object.rb', line 97

def delegated_method
  @delegated_method
end

#objectObject

Returns the value of attribute object



97
98
99
# File 'lib/method_object.rb', line 97

def object
  @object
end

Instance Method Details

#candidate?Boolean



98
99
100
# File 'lib/method_object.rb', line 98

def candidate?
  object.respond_to?(delegated_method)
end