Due to setup of the helper calling the get or set methods on any js object bound to a ruby object will call the accessibe_names each time. This will result in the duplication of the ancestors array which will be used for iteration and then discarded, which is quite inefficient if you plan on calling into ruby often.
Note, an identical and even faster effect could be achieved by refactoring the class to testing where a method is defined using a process like this:
def method_below_object
begin
ancestors = obj.class.ancestors
index_of_object = ancestors.index(Object)
index_of_method_owner = ancestors.index(obj.method(name).owner)
return index_of_method_owner < index_of_object
rescue
return false
end
end
Due to setup of the helper calling the get or set methods on any js object bound to a ruby object will call the accessibe_names each time. This will result in the duplication of the ancestors array which will be used for iteration and then discarded, which is quite inefficient if you plan on calling into ruby often.
Note, an identical and even faster effect could be achieved by refactoring the class to testing where a method is defined using a process like this:
I can implement the change if there is interest.