Ah! I had no idea that method existed. Thank you, Mr. Anning!

On Thu, Sep 18, 2008 at 11:13 AM, jerry anning <[EMAIL PROTECTED]> wrote:
> Joshua, use every.
> every(1800) do
>   update_weather
> end
>
> On Thu, Sep 18, 2008 at 1:24 PM, Joshua Choi <[EMAIL PROTECTED]> wrote:
>>
>> In Shoes, the animate method repeats an action every so-and-so times a
>> second:
>>
>>  frequency = 100 # Hertz
>>  animate frequency do
>>    do_something
>>  end
>>
>> What if, however, I want to repeat an action once every ten minutes?
>> Specifically, I want my weather program to check the weather every so
>> often automatically. I can't do this with animate(): animate() only
>> takes integers, which means it can only repeat something with a cycle
>> period of less than or equal to one second.
>>
>> Would it possible to implement a method that repeats an action less
>> often than a second? Like this:
>>
>>  period = 1800 # seconds
>>  repeat_every period do
>>    update_weather
>>  end
>>
>> Sincerely,
>> Joshua Choi
>
>

Reply via email to