diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-07 12:52:10 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2011-05-07 12:52:10 +0200 |
commit | de61814d34c6fe52233ca2e61bd97d0ba18bea17 (patch) | |
tree | 7b3b64f43673a075f2f75f8de0d4f314bfd69c56 /lib/efl | |
parent | 0bf71f9bcfe8b06d1c14a85c9d4a7fb8a57bb355 (diff) | |
download | ffi-efl-de61814d34c6fe52233ca2e61bd97d0ba18bea17.zip ffi-efl-de61814d34c6fe52233ca2e61bd97d0ba18bea17.tar.gz |
cleanup REvasObject#initialize
Diffstat (limited to 'lib/efl')
-rw-r--r-- | lib/efl/evas.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/efl/evas.rb b/lib/efl/evas.rb index 7f0fd8b..560cc49 100644 --- a/lib/efl/evas.rb +++ b/lib/efl/evas.rb @@ -125,17 +125,15 @@ module Efl include Efl::ClassHelper search_prefixes 'evas_object_', 'evas_' # - def initialize *args + def initialize a, *args @ptr = ( - case args[0] - when NilClass - FFI::AutoPointer.new Native.evas_new, REvasObject.method(:release) + case a when FFI::Pointer - args[0] + a when Method - FFI::AutoPointer.new args[0].call(args[1]), REvasObject.method(:release) + FFI::AutoPointer.new a.call(*args), REvasObject.method(:release) else - raise ArgumentError.new "wrong argument #{args[0].class.name}" + raise ArgumentError.new "wrong argument #{a.class.name}" end ) yield self if block_given? |