lib/one2influx/config.rb
# Converts local variable human_interval to seconds
#  and stores in sec_interval
Converts local variable human_interval to seconds
and stores in sec_interval
Converts local variable human_interval to seconds and stores in sec_interval
def convert_to_sec
    duration = @@fetch_interval.split(' ')
    if duration.length != 2
      raise "Invalid @@fetch_interval(=#{@@fetch_interval}) in config.rb."
    end
    case duration[1]
      when /seconds?/
        multiply = 1
      when /minutes?/
        multiply = 60
      when /hours?/
        multiply = 3600
      else
        raise "Invalid @@fetch_interval(=#{@@fetch_interval}) in config.rb."
    end
    @sec_interval = duration[0].to_i * multiply
  end
def convert_to_sec duration = @@fetch_interval . split ( ' ' ) if duration . length != 2 raise "Invalid @@fetch_interval(=#{@@fetch_interval}) in config.rb." end case duration [ 1 ] when / seconds? / multiply = 1 when / minutes? / multiply = 60 when / hours? / multiply = 3600 else raise "Invalid @@fetch_interval(=#{@@fetch_interval}) in config.rb." end @sec_interval = duration [ 0 ] . to_i * multiply end
Converts local variable human_interval to seconds
and stores in sec_interval
Converts local variable human_interval to seconds and stores in sec_interval