rikai has quit [Read error: Connection reset by peer]
rhys has joined #cinch
rikai has joined #cinch
<rhys>
does anyone know how I can access a timer interval in a plugin?
davidboy has joined #cinch
jcrawford has joined #cinch
txdv_ has joined #cinch
cout_ has joined #cinch
bean__ is now known as bean
cout has quit [*.net *.split]
txdv has quit [*.net *.split]
<dominikh>
rhys: depends. generally speaking, Timer#interval. how you get that Timer object in the first place depends on how you created the timer
<rhys>
dominikh, so in the plugin, i was looking at the example
<rhys>
i would need to put instance variables to each of my timers. MahTimer = timer 5, method :timer
<rhys>
then in my method timer i could to MahTimer.interval? kay.
<dominikh>
that'd be one of multiple ways.
<rhys>
great. I'm learnng cinch to learn ruby.
<rhys>
or.. using cinch to learn ruby. so far so fun.
<dominikh>
:)
<rhys>
wait. just realized my problem. i'm trying to select between mutliple timers when they are passed to my method.
<rhys>
i read the timer code in plugin.rb, it seems to pass the timer?
<dominikh>
pass it where?
<rhys>
no. when i give the timer my method to run
<rhys>
i'm trying to use a single method to go through multiple timers
<dominikh>
the method won't know which timer caused it to be invoked.
<rhys>
ouch. then i need to make a fair few timers.
<rhys>
fair few methods i mean
<dominikh>
the real question is, why does the method need to know which timer is responsible?
<rhys>
its a stats keeping plugin. so i have a set of intervals. when each interval runs, it updates it respective stats averages. 1 hour, 2 hour, etc.
<rhys>
i guess i could always keep my own time. then when the timer calls my method it checks the time, figures out which summary it needs to run.
<dominikh>
ah. I'd have one method update_stats(interval), and one method per timer which calls update_stats with the right interval
rickmasta has joined #cinch
postmodern has quit [Quit: Leaving]
postmodern has joined #cinch
bean has quit [Quit: Computer has gone to sleep.]
rikai has quit [Remote host closed the connection]
rikai has joined #cinch
rickmasta has quit [Ping timeout: 256 seconds]
rickmasta has joined #cinch
postmodern has quit [Ping timeout: 260 seconds]
postmodern has joined #cinch
rickmasta has quit [Read error: Connection reset by peer]