Class: Dragonfly::App

Inherits:
Object
  • Object
show all
Defined in:
lib/dm-dragonfly.rb

Instance Method Summary collapse

Instance Method Details

#define_dm_macro(mod, macro_name) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/dm-dragonfly.rb', line 37

def define_dm_macro(mod, macro_name)
  app = self
  (class << mod; self; end).class_eval do
    alias included_without_dragonfly included
    define_method :included_with_dragonfly do |mod|
      included_without_dragonfly(mod)
      mod.extend(DataMapperExtensions)
      mod.register_dragonfly_app(macro_name, app)
    end
    alias included included_with_dragonfly
  end
end