module Moguro::Decorator::ClassMethods
Public Instance Methods
contract_handler()
click to toggle source
Validates the arguments to the method @since 0.0.1 @param [Lambda|Proc] callback @return [Void]
# File lib/moguro/decorator.rb, line 64 def contract_handler @contract_handler ||= Moguro::Handlers::ClassHandler.new(self) end
method_added(name)
click to toggle source
Calls superclass method
# File lib/moguro/decorator.rb, line 30 def method_added(name) return super unless Moguro.enabled? && contract_handler.validatable? super contract_handler.handle_method(name) end
post_c(callback)
click to toggle source
Validates the arguments to the method @since 0.0.1 @param [Lambda|Proc] callback @return [Void]
# File lib/moguro/decorator.rb, line 53 def post_c(callback) return unless Moguro.enabled? contract_handler.contract_return_value(callback) end
pre_c(callback)
click to toggle source
Validates the arguments to the method @since 0.0.1 @param [Lambda|Proc] callback @return [Void]
# File lib/moguro/decorator.rb, line 42 def pre_c(callback) return unless Moguro.enabled? contract_handler.contract_arguments(callback) end
singleton_method_added(name)
click to toggle source
Calls superclass method
# File lib/moguro/decorator.rb, line 24 def singleton_method_added(name) return super unless Moguro.enabled? && contract_handler.validatable? super contract_handler.handle_singleton_method(name) end