Exception: Sunniesnow::Charter::TipPointError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/sscharter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*expected_state, actual_state) ⇒ TipPointError

Returns a new instance of TipPointError.



20
21
22
# File 'lib/sscharter.rb', line 20

def initialize *expected_state, actual_state
	super "wrong tip point state: expected #{expected_state.join ' or '}, got #{actual_state}"
end

Class Method Details

.ensure(state, *expected) ⇒ Object



24
25
26
# File 'lib/sscharter.rb', line 24

def self.ensure state, *expected
	raise self.new *expected, state unless expected.include? state
end