Method: Counter#set

Defined in:
lib/counter/counter.rb

#set(key, count) ⇒ Object

sets the key to a specified value

Raises:

  • (ArgumentError)


47
48
49
50
# File 'lib/counter/counter.rb', line 47

def set key, count
  raise ArgumentError, "count must be numeric" if !count.is_a?(Numeric)
  @data[key] = count
end