Class: Rulz::Definer
- Inherits:
-
Object
- Object
- Rulz::Definer
- Defined in:
- lib/rulz/definer.rb
Instance Method Summary collapse
- #action(name, &block) ⇒ Object
- #attribute(attr, &block) ⇒ Object
- #condition(name, &block) ⇒ Object
-
#initialize(klass) ⇒ Definer
constructor
A new instance of Definer.
- #rule(&block) ⇒ Object
Constructor Details
#initialize(klass) ⇒ Definer
Returns a new instance of Definer.
4 5 6 |
# File 'lib/rulz/definer.rb', line 4 def initialize(klass) @klass = klass end |
Instance Method Details
#action(name, &block) ⇒ Object
12 13 14 |
# File 'lib/rulz/definer.rb', line 12 def action(name, &block) Rulz::Action.new(name, @klass, block) end |
#attribute(attr, &block) ⇒ Object
20 21 22 |
# File 'lib/rulz/definer.rb', line 20 def attribute(attr, &block) Rulz::Attribute::Block.new(attr, @klass, &block) end |