Class: Aniview::Interface::AnimeSeries
- Inherits:
-
Item
- Object
- Item
- Aniview::Interface::AnimeSeries
show all
- Includes:
- Util
- Defined in:
- lib/aniview/interface/animeio/animeseries.rb
Instance Attribute Summary
Attributes inherited from Item
#attr
Instance Method Summary
collapse
Methods included from Util
decode_object, encode_object, error_message, format_duration, format_progress, format_size, parse_format, readline
Methods inherited from Item
#cereal
Constructor Details
#initialize(path, children = []) ⇒ AnimeSeries
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/aniview/interface/animeio/animeseries.rb', line 11
def initialize(path, children = [])
@path = path
@attr = {
"t" => String(@path),
"c" => 0,
"d" => 0,
"s" => 0,
}
@children = children
@children.each { |c| self + c }
end
|
Instance Method Details
#+(af) ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/aniview/interface/animeio/animeseries.rb', line 25
def + af
@attr["d"] += af.attr["d"]
@attr["D"] = Util.format_duration @attr["d"]
@attr["s"] += af.attr["s"]
@attr["S"] = Util.format_size @attr["s"]
@attr["c"] += 1
end
|
#attributes ⇒ Object
37
38
39
|
# File 'lib/aniview/interface/animeio/animeseries.rb', line 37
def attributes
return @attr
end
|
#title ⇒ Object
33
34
35
|
# File 'lib/aniview/interface/animeio/animeseries.rb', line 33
def title
return @path
end
|