Class: Onuro::EventBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/onuro/event_builder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ EventBuilder

Returns a new instance of EventBuilder.



7
8
9
# File 'lib/onuro/event_builder.rb', line 7

def initialize(name)
  self.event = Event.new(name)
end

Instance Attribute Details

#eventObject

Returns the value of attribute event.



5
6
7
# File 'lib/onuro/event_builder.rb', line 5

def event
  @event
end

Class Method Details

.build(name) {|builder| ... } ⇒ Object

Yields:

  • (builder)


33
34
35
36
37
# File 'lib/onuro/event_builder.rb', line 33

def self.build(name)
  builder = new(name)
  yield builder if block_given?
  builder.event
end

Instance Method Details

#add_event_strategy(event_strategy) ⇒ Object



11
12
13
# File 'lib/onuro/event_builder.rb', line 11

def add_event_strategy(event_strategy)
  event.event_strategy = event_strategy
end

#add_rule_stage(rule_stage) ⇒ Object



19
20
21
# File 'lib/onuro/event_builder.rb', line 19

def add_rule_stage(rule_stage)
  event.add_rule_stage(rule_stage)
end

#add_ruleset_stage(ruleset_stage) ⇒ Object



15
16
17
# File 'lib/onuro/event_builder.rb', line 15

def add_ruleset_stage(ruleset_stage)
  event.add_ruleset_stage(ruleset_stage)
end

#exec_order(order) ⇒ Object



23
24
25
26
# File 'lib/onuro/event_builder.rb', line 23

def exec_order(order)
  # can be :asc, :desc, :none by default (order is as rules were introduced
  # in the ruleset_stage list)
end

#ignore_diseabledObject



28
29
30
31
# File 'lib/onuro/event_builder.rb', line 28

def ignore_diseabled
  # sets to true and all the diseablked rules will be executed
  # default should be false, so diseabled rules will not be executed
end