Class: Cassanity::Increment

Inherits:
Operator show all
Defined in:
lib/cassanity/increment.rb

Instance Attribute Summary

Attributes inherited from Operator

#symbol, #value

Instance Method Summary collapse

Methods inherited from Operator

#eql?, #inspect

Constructor Details

#initialize(value = 1) ⇒ Increment

Public: Returns an increment instance

Raises:

  • (ArgumentError)


8
9
10
11
12
# File 'lib/cassanity/increment.rb', line 8

def initialize(value = 1)
  raise ArgumentError.new("value cannot be nil") if value.nil?

  super :+, value
end