Module: Moguro::Decorator

Defined in:
lib/moguro/decorator.rb

Overview

Provide contract programming feature to the class that included this module. Validates the arguments to the method, and validates the return value of the method. And you arbitrary test possible by Assertion library.

Since:

  • 0.0.1

Defined Under Namespace

Modules: ClassMethods Classes: CONTRACT_CONTAINER

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

Since:

  • 0.0.1



13
14
15
16
17
18
19
20
21
# File 'lib/moguro/decorator.rb', line 13

def self.included(klass)
  klass.extend(ClassMethods)
  klass.include(Moguro::Types)
  # @todo
  return unless Moguro.enabled?
  require 'test/unit/assertions'
  klass.include(Test::Unit::Assertions)
  klass.extend(Test::Unit::Assertions)
end