Class: Transit::ReadHandlers::SpecialNumbersHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/transit/read_handlers.rb

Instance Method Summary collapse

Instance Method Details

#from_rep(v) ⇒ Object



46
47
48
49
50
51
52
53
# File 'lib/transit/read_handlers.rb', line 46

def from_rep(v)
  case v
  when "NaN"  then  Float::NAN
  when "INF"  then  Float::INFINITY
  when "-INF" then -Float::INFINITY
  else raise ArgumentError.new("Don't know how to handle #{v.inspect} for the \"z\" tag")
  end
end