Sha256: 99cba602a66a9df62d5d2830c93a877fce4244f9c8059546201562fd9c04e40c

Contents?: true

Size: 445 Bytes

Versions: 9

Compression:

Stored size: 445 Bytes

Contents

class Shoes
  class Widget
    def self.inherited klass, &blk
      m = klass.inspect.downcase.split('::').last
      Shoes::App.class_eval do
        define_method m do |*args, &blk|
          klass.class_variable_set :@@app, self
          klass.new *args, &blk
        end
      end
      klass.class_eval do
        def method_missing m, *arg, &blk
         @@app.send m, *arg, &blk
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
green_shoes-0.198.0 lib/shoes/widget.rb
green_shoes-0.189.0 lib/shoes/widget.rb
green_shoes-0.179.0 lib/shoes/widget.rb
green_shoes-0.176.0 lib/shoes/widget.rb
green_shoes-0.171.0 lib/shoes/widget.rb
green_shoes-0.164.0 lib/shoes/widget.rb
green_shoes-0.150.0 lib/shoes/widget.rb
green_shoes-0.139.0 lib/shoes/widget.rb
green_shoes-0.138.0 lib/shoes/widget.rb