Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/rulebook/core_ext/module.rb

Overview

++ Should this be class Object? Is there really a difference? –

Instance Method Summary collapse

Instance Method Details

#follows_the_rules!Object

This declares that the current class has a rulebook with rules that it wants it’s instances to follow.

I picked this name because the probability of someone needing the method ‘follows_the_rules!’ (with a bang) is slim… hopefully.

This adds the following method:

User#rulebook
  Returns the RuleBook instance that contains the defined rules.


17
18
19
20
21
22
23
# File 'lib/rulebook/core_ext/module.rb', line 17

def follows_the_rules!
  extend(MetaTools)
  include(MetaTools)
  
  extend(Rulebook::ClassMethods)
  include(Rulebook::InstanceMethods)
end