class Rulz::Definer
Public Class Methods
new(klass)
click to toggle source
# File lib/rulz/definer.rb, line 4 def initialize(klass) @klass = klass end
Public Instance Methods
action(name, &block)
click to toggle source
# File lib/rulz/definer.rb, line 12 def action(name, &block) Rulz::Action.new(name, @klass, block) end
attribute(attr, &block)
click to toggle source
# File lib/rulz/definer.rb, line 20 def attribute(attr, &block) Rulz::Attribute::Block.new(attr, @klass, &block) end
condition(name, &block)
click to toggle source
# File lib/rulz/definer.rb, line 8 def condition(name, &block) Rulz::Condition.new(name, @klass, block) end
rule(&block)
click to toggle source
# File lib/rulz/definer.rb, line 16 def rule(&block) Rulz::Rule.new(@klass, block) end