Class: RakeMKV::Title
- Inherits:
-
Object
- Object
- RakeMKV::Title
- Defined in:
- lib/rakemkv/title.rb
Overview
Title
Constant Summary collapse
- MINUTE =
60
- HOUR =
3600
Instance Attribute Summary collapse
-
#chapter_count ⇒ Object
readonly
Returns the value of attribute chapter_count.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(id, options = {}) ⇒ Title
constructor
Initialize with a required id.
-
#short_length? ⇒ Boolean
Find short lengthed title.
- #time ⇒ Object
Constructor Details
#initialize(id, options = {}) ⇒ Title
Initialize with a required id
9 10 11 12 13 14 15 |
# File 'lib/rakemkv/title.rb', line 9 def initialize(id, = {}) # These claim to start at 1, but the CLI treats them as starting from 0 @id = id @duration = [:duration] @chapter_count = [:chapter_count].to_i @size = [:disk_size_bytes].to_i end |
Instance Attribute Details
#chapter_count ⇒ Object (readonly)
Returns the value of attribute chapter_count.
3 4 5 |
# File 'lib/rakemkv/title.rb', line 3 def chapter_count @chapter_count end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/rakemkv/title.rb', line 3 def code @code end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/rakemkv/title.rb', line 3 def id @id end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/rakemkv/title.rb', line 3 def size @size end |
Instance Method Details
#short_length? ⇒ Boolean
Find short lengthed title
18 19 20 |
# File 'lib/rakemkv/title.rb', line 18 def short_length? time > 900 && time < 2100 end |
#time ⇒ Object
22 23 24 |
# File 'lib/rakemkv/title.rb', line 22 def time time_from_integer || time_from_string end |