Method: Safe::Enum._typecheck_enum!

Defined in:
lib/enums/enum.rb

._typecheck_enum!(o) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/enums/enum.rb', line 19

def self._typecheck_enum!( o )
  if o.instance_of?( self )
    o
  else
    raise TypeError.new( "[Enum] enum >#{name}< type expected; got >#{o.class.inspect}<" )
  end
end