Class: TimeScheduler::EventItem

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/time_scheduler/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time, queue, ident) ⇒ EventItem

Returns a new instance of EventItem.



11
12
13
14
15
# File 'lib/time_scheduler/event.rb', line 11

def initialize( time, queue, ident )
  @time  =  time
  @queue  =  queue
  @ident  =  ident
end

Instance Attribute Details

#identObject (readonly)

Returns the value of attribute ident.



9
10
11
# File 'lib/time_scheduler/event.rb', line 9

def ident
  @ident
end

#queueObject (readonly)

Returns the value of attribute queue.



9
10
11
# File 'lib/time_scheduler/event.rb', line 9

def queue
  @queue
end

#timeObject (readonly)

Returns the value of attribute time.



9
10
11
# File 'lib/time_scheduler/event.rb', line 9

def time
  @time
end

Instance Method Details

#<=>(other) ⇒ Object



17
18
19
20
# File 'lib/time_scheduler/event.rb', line 17

def <=>( other )
  return  nil    unless other.is_a?( EventItem )
  self.time <=> other.time
end