Skip to content
automatthew edited this page Sep 12, 2010 · 12 revisions
require 'autocode'

module Thingy
  extend Autocreate; extend Autoload; extend Reloadable

  autocreate :Mabob, Module.new do 
    extend Autoload
    autoload true
    directories :test_lib
  end
end

Thingy.module_eval do
  extend Autodef
  autodef(:Mabob) do
    def self.in_scope; true; end
  end

  autodef('Mabob::Doodad') do
    def self.outside_scope; true; end
    def instance; true; end
  end

  autodef('Mabob::Doodad') do
    def self.gizmo; 2; end
  end
end

Clone this wiki locally