Class: Textus::Workflow::Collector

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/workflow/collector.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(registry) ⇒ Collector

Returns a new instance of Collector.



18
19
20
# File 'lib/textus/workflow/collector.rb', line 18

def initialize(registry)
  @registry = registry
end

Class Attribute Details

.currentObject (readonly)

Returns the value of attribute current.



7
8
9
# File 'lib/textus/workflow/collector.rb', line 7

def current
  @current
end

Class Method Details

.with(collector) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/textus/workflow/collector.rb', line 10

def self.with(collector)
  prev      = @current
  @current  = collector
  yield
ensure
  @current = prev
end

Instance Method Details

#register(defn) ⇒ Object



22
23
24
# File 'lib/textus/workflow/collector.rb', line 22

def register(defn)
  @registry.register(defn)
end