diff options
Diffstat (limited to 'lib/efl/native/evas.rb')
-rw-r--r-- | lib/efl/native/evas.rb | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/lib/efl/native/evas.rb b/lib/efl/native/evas.rb index bd316e0..4f258d0 100644 --- a/lib/efl/native/evas.rb +++ b/lib/efl/native/evas.rb @@ -7,31 +7,11 @@ module Efl # module Evas # + FCT_PREFIX = 'evas_' + # def self.method_missing m, *args, &block - m_s = m.to_s - if m_s =~/^(.*)=$/ - m_s = $1+'_set' - args_s = '*args[0]' - elsif m_s =~/^(.*)\?$/ - m_s = $1+'_get' - args_s = '*args' - else - args_s = '*args' - end - sym = ( - if Efl::Native.respond_to? 'evas_'+m_s - 'evas_'+m_s - elsif Efl::Native.respond_to? m_s - m_s - elsif Efl::Native.respond_to? 'evas_'+m_s+'_get' - 'evas_'+m_s+'_get' - elsif Efl::Native.respond_to? m_s+'_get' - m_s+'_get' - else - raise NameError.new "#{self.name}.#{m_s} (#{m})" - end - ) - self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(*args); yield r if block_given?; r; end" + sym, args_s = ModuleHelper.find_function m, FCT_PREFIX + self.module_eval "def self.#{m} *args, █ r=Efl::Native.#{sym}(#{args_s}); yield r if block_given?; r; end" self.send m, *args, &block end # |