lib/remarkable/dsl/callbacks.rb in remarkable-3.0.8 vs lib/remarkable/dsl/callbacks.rb in remarkable-3.0.9
- old
+ new
@@ -6,20 +6,38 @@
base.extend ClassMethods
end
module ClassMethods
protected
- # Class method that accepts a block or a symbol which is called after initialization.
+ # Class method that accepts a block or a symbol which is called after
+ # initialization.
+ #
+ # == Examples
+ #
+ # after_initialize :evaluate_given_blocks
+ #
+ # after_initialize do
+ # # code
+ # end
#
def after_initialize(symbol=nil, &block)
if block_given?
@after_initialize_callbacks << block
elsif symbol
@after_initialize_callbacks << symbol
end
end
- # Class method that accepts a block or a symbol which is called before assertion.
+ # Class method that accepts a block or a symbol which is called before
+ # running assertions.
+ #
+ # == Examples
+ #
+ # before_assert :evaluate_given_blocks
+ #
+ # before_assert do
+ # # code
+ # end
#
def before_assert(symbol=nil, &block)
if block_given?
@before_assert_callbacks << block
elsif symbol