Class: Cassanity::Decrement

Inherits:
Operator show all
Defined in:
lib/cassanity/decrement.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) ⇒ Decrement

Public: Returns an decrement instance

Raises:

  • (ArgumentError)


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

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

  super :-, value
end