lib/pycall/pyobject_wrapper.rb in pycall-0.1.0.alpha.20170419b vs lib/pycall/pyobject_wrapper.rb in pycall-0.1.0.alpha.20170419
- old
+ new
@@ -166,18 +166,10 @@
return res.to_ruby if LibPython.PyErr_Occurred().null?
raise PyError.fetch
end
def method_missing(name, *args, **kwargs)
- name_s = name.to_s
- if name_s.end_with? '='
- name = name_s[0..-2]
- if PyCall.hasattr?(__pyobj__, name.to_s)
- PyCall.setattr(__pyobj__, name, args.first)
- else
- raise NameError, "object has no attribute `#{name}'"
- end
- elsif PyCall.hasattr?(__pyobj__, name.to_s)
+ if PyCall.hasattr?(__pyobj__, name.to_s)
PyCall.getattr(__pyobj__, name)
else
super
end
end