Class: Collective::Messager::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/collective/messager.rb

Instance Method Summary collapse

Instance Method Details

#failObject

Raises:



160
161
162
163
# File 'lib/collective/messager.rb', line 160

def fail
  @value = nil
  raise NoMatch
end

#matchObject



156
157
158
159
# File 'lib/collective/messager.rb', line 156

def match
  @value ||= 0
  @value += 1
end

#valueObject

Raises:



164
165
166
167
# File 'lib/collective/messager.rb', line 164

def value
  raise NoMatch if !@value
  @value
end