lib/rubypython/operators.rb in lokeshh_rubypython-0.7 vs lib/rubypython/operators.rb in lokeshh_rubypython-0.7.1
- old
+ new
@@ -29,15 +29,15 @@
# or a String.
# [pname] The name of the \Python magic method to which this method should
# be delegated.
def self.rel_op(rname, pname)
define_method rname.to_sym do |other|
- RubyPython::Operators.operator_.__send__(pname, self, other).rubify
+ RubyPython::Operators.operator_.__send__(pname, self, other)
end
end
- # Creates a method to delegate a relational operator.
+ # Creates a method to delegate a relational operator.
# These methods are implemented with calls the _operator_ module.
# [rname] The name of the Ruby method for this operation. Can be a Symbol
# or a String.
# [pname] The name of the \Python magic method to which this method should
# be delegated.
@@ -70,14 +70,14 @@
].each do |args|
unary_op *args
end
[
- [:==, 'eq'],
- [:<, 'lt'],
- [:<=, 'le'],
- [:>, 'gt'],
- [:>=, 'ge'],
+ [:==, '__eq__'],
+ [:<, '__lt__'],
+ [:<=, '__le__'],
+ [:>, '__gt__'],
+ [:>=, '__ge__'],
[:equal?, 'is_']
].each do |args|
rel_op *args
end