Module: Netzke::Core::Composition::ClassMethods

Defined in:
lib/netzke/core/composition.rb

Instance Method Summary collapse

Instance Method Details

#component(name, options = {}, &block) ⇒ Object



99
100
101
102
103
# File 'lib/netzke/core/composition.rb', line 99

def component(name, options = {}, &block)
  define_method :"#{name}_component", &(block || ->(c){c})
  # NOTE: "<<" won't work here as this will mutate the array shared between classes
  self.eagerly_loaded_dsl_components += [name] if options[:eager_load]
end