Class: TimeChunk

Inherits:
Object
  • Object
show all
Includes:
AASM
Defined in:
lib/entities/time_chunk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, scheduled_duration: nil, timestamping_method: Time.method(:now)) ⇒ TimeChunk

Public Interface



14
15
16
17
18
19
# File 'lib/entities/time_chunk.rb', line 14

def initialize(name: nil, scheduled_duration: nil, timestamping_method: Time.method(:now))
  self.id                   = SecureRandom.uuid
  self.name                 = name
  self.scheduled_duration   = scheduled_duration
  self.timestamping_method  = timestamping_method # Injectable clock
end

Instance Attribute Details

#finish_timeObject

Returns the value of attribute finish_time.



22
23
24
# File 'lib/entities/time_chunk.rb', line 22

def finish_time
  @finish_time
end

#idObject

Returns the value of attribute id.



22
23
24
# File 'lib/entities/time_chunk.rb', line 22

def id
  @id
end

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/entities/time_chunk.rb', line 22

def name
  @name
end

#scheduled_durationObject

Returns the value of attribute scheduled_duration.



22
23
24
# File 'lib/entities/time_chunk.rb', line 22

def scheduled_duration
  @scheduled_duration
end

#start_timeObject

Returns the value of attribute start_time.



22
23
24
# File 'lib/entities/time_chunk.rb', line 22

def start_time
  @start_time
end

#timestamping_methodObject

Returns the value of attribute timestamping_method.



22
23
24
# File 'lib/entities/time_chunk.rb', line 22

def timestamping_method
  @timestamping_method
end