Class: Typecast::Models::AlignmentSegmentWord
- Inherits:
-
Object
- Object
- Typecast::Models::AlignmentSegmentWord
- Defined in:
- lib/typecast/timestamps.rb
Instance Attribute Summary collapse
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#word ⇒ Object
readonly
Returns the value of attribute word.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(word:, start_time:, end_time:) ⇒ AlignmentSegmentWord
constructor
A new instance of AlignmentSegmentWord.
Constructor Details
#initialize(word:, start_time:, end_time:) ⇒ AlignmentSegmentWord
Returns a new instance of AlignmentSegmentWord.
12 13 14 15 16 |
# File 'lib/typecast/timestamps.rb', line 12 def initialize(word:, start_time:, end_time:) @word = word @start_time = start_time @end_time = end_time end |
Instance Attribute Details
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
6 7 8 |
# File 'lib/typecast/timestamps.rb', line 6 def end_time @end_time end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
6 7 8 |
# File 'lib/typecast/timestamps.rb', line 6 def start_time @start_time end |
#word ⇒ Object (readonly)
Returns the value of attribute word.
6 7 8 |
# File 'lib/typecast/timestamps.rb', line 6 def word @word end |
Class Method Details
.from_h(hash) ⇒ Object
8 9 10 |
# File 'lib/typecast/timestamps.rb', line 8 def self.from_h(hash) new(word: hash.fetch("word", ""), start_time: hash.fetch("start_time", 0).to_f, end_time: hash.fetch("end_time", 0).to_f) end |