From: Robert Klemme Date: 2012-12-28T20:40:17+09:00 Subject: Re: numeric? On Fri, Dec 28, 2012 at 1:00 AM, Brandon Weaver wrote: > I've already sorted them into classes and objects, so instance variables are > created for every antenna and other such things. The more I think about it the more I do believe it is responsibility of the "driver" (i.e. the bit that fetches the data) to return _proper data_. In this case it would mean: do not return numbers as strings. If values are invalid return a special value for that; this value could be nil or one or more symbols depending on how many states need to be represented. The using code should expect data properly typed so it can do its business. Another thought: if you create instance variables on the fly for sensors then a Hash is probably a better alternative. You could use a specific class as values which encapsulates the data along with meta data (valid, available, taken at...). Example SensorData = Struct.new :name, :value, :taken_at do def valid? value # nil is invalid end end Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/