lib/gruff/scene.rb
# Choose the appropriate filename for this layer, based on the input
Choose the appropriate filename for this layer, based on the input
Choose the appropriate filename for this layer based on the input
def update(value)
    @selected_filename = begin
      case value.to_s
      when /^(true|false)$/
        select_boolean value
      when /^(\w|\s)+$/
        select_string value
      when /^-?(\d+\.)?\d+$/
        select_numeric value
      when /(\d\d):(\d\d):\d\d/
        select_time "#{Regexp.last_match(1)}#{Regexp.last_match(2)}"
      else
        select_default
      end
    end
    @selected_filename ||= select_default
  end
def update ( value ) @selected_filename = begin case value . to_s when / ^(true|false)$ / select_boolean value when / ^( \w | \s )+$ / select_string value when / ^-?( \d + \. )? \d +$ / select_numeric value when / ( \d \d ):( \d \d ): \d \d / select_time "#{Regexp.last_match(1)}#{Regexp.last_match(2)}" else select_default end end @selected_filename ||= select_default end
Choose the appropriate filename for this layer, based on the input
Choose the appropriate filename for this layer based on the input
# Finally, try to use 'default' if we're still blank
value
<not_specific>