gtsr/lib/gts/helper.rb
# Either value will match a period, or default to GTS::MINUTE
Either value will match a period, or default to GTS::MINUTE
Either value will match a period or default to GTS :: MINUTE
def validate_periodicity(value=nil?)
      periodicity = GTS::MINUTE
      if(!value.nil?)
        num = value.to_i
        case num
        when GTS::YEAR
          periodicity = GTS::YEAR
        when GTS::MONTH
          periodicity = GTS::MONTH
        when GTS::DAY
          periodicity = GTS::DAY
        when GTS::HOUR
          periodicity = GTS::HOUR
        when GTS::MINUTE
          periodicity = GTS::MINUTE
        when GTS::SECOND
          periodicity = GTS::SECOND
        end
      end
      return periodicity
    end
def validate_periodicity ( value = nil? ) periodicity = GTS :: MINUTE if ( ! value . nil? ) num = value . to_i case num when GTS :: YEAR periodicity = GTS :: YEAR when GTS :: MONTH periodicity = GTS :: MONTH when GTS :: DAY periodicity = GTS :: DAY when GTS :: HOUR periodicity = GTS :: HOUR when GTS :: MINUTE periodicity = GTS :: MINUTE when GTS :: SECOND periodicity = GTS :: SECOND end end return periodicity end
Either value will match a period, or default to GTS::MINUTE
Either value will match a period or default to GTS :: MINUTE
value
<not_specific>
nil?
<not_specific>