lib/rubypython/wrapper_extensions.rb in rubypython-0.2.3 vs lib/rubypython/wrapper_extensions.rb in rubypython-0.2.4
- old
+ new
@@ -13,12 +13,13 @@
#
# == Block Syntax
# The PyMainClass object provides somewhat experimental block support.
# A block may be passed to a method call and the object returned by the function call
# will be passed as an argument to the block.
-class PyMainClass
+class PyMainClass < RubyPythonBridge::BlankObject
include Singleton
+ attr_writer :main, :builtin
#:nodoc:
def main
@main||=RubyPython.import "__main__"
end
@@ -39,9 +40,10 @@
end
end
if(block)
return block.call(result)
end
+ result
end
end
# See _PyMainClass_
PyMain=PyMainClass.instance
\ No newline at end of file