Method: RedShift::Component.defaults

Defined in:
lib/redshift/syntax.rb

.defaults(h = nil, &block) ⇒ Object Also known as: default

Register, for the current component class, the given block to be called at the beginning of initialization of an instance. The block is called with the world as self. Any number of blocks can be registered.



81
82
83
84
# File 'lib/redshift/syntax.rb', line 81

def defaults(h = nil, &block)
  (@defaults_procs ||= []) << block if block
  (@defaults_map ||= {}).update make_init_value_map(h) if h
end