Sha256: 557e2ca2e9d269abcda3320917ba30aafbdd79c9f24b4678854aadd9df3647d3
Contents?: true
Size: 600 Bytes
Versions: 6
Compression:
Stored size: 600 Bytes
Contents
module Flutterby # NodeExtension is a subclass of Module that also provides a convenient # `setup` method for quick creation of initialization code. It's used # to wrap the blocks of code passed to {Node#extend_all} and friends, # but can also be used directly through `NodeExtension.new { ... }`. # class NodeExtension < Module def initialize(*args) @_setup_procs = [] super end def extended(base) if @_setup_procs.any? base._setup_procs.append(*@_setup_procs) end end def on_setup(&blk) @_setup_procs << blk end end end
Version data entries
6 entries across 6 versions & 1 rubygems