Class: Typecast::Models::AlignmentSegmentCharacter

Inherits:
Object
  • Object
show all
Defined in:
lib/typecast/timestamps.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(character:, start_time:, end_time:) ⇒ AlignmentSegmentCharacter

Returns a new instance of AlignmentSegmentCharacter.



26
27
28
29
30
# File 'lib/typecast/timestamps.rb', line 26

def initialize(character:, start_time:, end_time:)
  @character = character
  @start_time = start_time
  @end_time = end_time
end

Instance Attribute Details

#characterObject (readonly)

Returns the value of attribute character.



20
21
22
# File 'lib/typecast/timestamps.rb', line 20

def character
  @character
end

#end_timeObject (readonly)

Returns the value of attribute end_time.



20
21
22
# File 'lib/typecast/timestamps.rb', line 20

def end_time
  @end_time
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



20
21
22
# File 'lib/typecast/timestamps.rb', line 20

def start_time
  @start_time
end

Class Method Details

.from_h(hash) ⇒ Object



22
23
24
# File 'lib/typecast/timestamps.rb', line 22

def self.from_h(hash)
  new(character: hash.fetch("character", ""), start_time: hash.fetch("start_time", 0).to_f, end_time: hash.fetch("end_time", 0).to_f)
end