How to reorganized time.points in timeline diapasons?

14 views
Skip to first unread message

Psycho Shine

unread,
Dec 18, 2014, 6:46:00 AM12/18/14
to rubyonra...@googlegroups.com

Hi,

Timer has_many points

and I want to create timeline, where timer.start(Time.now)
every moment i can timer.points.create(Time.now)
and of course timeline have a timer.end(Time.now)

point_params(:id, :time)

How reorganizing timer.points in simple timer with diapasons, where, for exemple, Timeline.new{timer.points.first(0..5), timer.points.second(6..12)  ... timer.points.last(39...44)}  ?

Any solutions, ideas, practice?
TY

Hassan Schroeder

unread,
Dec 18, 2014, 11:13:20 AM12/18/14
to rubyonrails-talk
On Thu, Dec 18, 2014 at 3:46 AM, Psycho Shine <annd...@gmail.com> wrote:

> How reorganizing timer.points in simple timer with diapasons, where, for
> exemple, Timeline.new{timer.points.first(0..5), timer.points.second(6..12)
> ... timer.points.last(39...44)} ?

> Any solutions, ideas, practice?

I have utterly no clue what you're trying to do, but sure, here's an idea:

Write some tests.

Describe the desired behavior *in code* and you're nearly there. It's
a habit you can't acquire soon enough :-)

Good luck.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Reply all
Reply to author
Forward
0 new messages