Class: Benelux::Track

Inherits:
Object show all
Defined in:
lib/benelux/track.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n, t) ⇒ Track

Returns a new instance of Track.



9
10
11
12
13
# File 'lib/benelux/track.rb', line 9

def initialize(n,t)
  @name, @thgrp = n, ThreadGroup.new
  @timeline = t || Benelux::Timeline.new
  @rotated_timelines = []
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/benelux/track.rb', line 5

def name
  @name
end

#rotated_timelinesObject (readonly)

Returns the value of attribute rotated_timelines.



8
9
10
# File 'lib/benelux/track.rb', line 8

def rotated_timelines
  @rotated_timelines
end

#thread_groupObject (readonly)

Returns the value of attribute thread_group.



6
7
8
# File 'lib/benelux/track.rb', line 6

def thread_group
  @thread_group
end

#timelineObject (readonly)

Returns the value of attribute timeline.



7
8
9
# File 'lib/benelux/track.rb', line 7

def timeline
  @timeline
end

Instance Method Details

#add_tags(args = Selectable::Tags.new) ⇒ Object



21
22
23
# File 'lib/benelux/track.rb', line 21

def add_tags(args=Selectable::Tags.new)
  timeline.add_default_tags args
end

#add_thread(t = Thread.current) ⇒ Object



14
15
16
17
# File 'lib/benelux/track.rb', line 14

def add_thread(t=Thread.current)
  @thgrp.add t
  t
end

#remove_tags(*args) ⇒ Object



24
25
26
# File 'lib/benelux/track.rb', line 24

def remove_tags(*args)
  timeline.remove_default_tags *args
end

#threadsObject



18
19
20
# File 'lib/benelux/track.rb', line 18

def threads
  @thgrp.list
end