Class: EhbrsRubyUtils::Videos::Series::Rename::SeasonGroup

Inherits:
LineResult
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/videos/series/rename/season_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(season, files) ⇒ SeasonGroup

Returns a new instance of SeasonGroup.



12
13
14
15
16
# File 'lib/ehbrs_ruby_utils/videos/series/rename/season_group.rb', line 12

def initialize(season, files)
  super()
  @season = season
  @files = files.sort_by { |f| [f.episode] }
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



10
11
12
# File 'lib/ehbrs_ruby_utils/videos/series/rename/season_group.rb', line 10

def files
  @files
end

#seasonObject (readonly)

Returns the value of attribute season.



10
11
12
# File 'lib/ehbrs_ruby_utils/videos/series/rename/season_group.rb', line 10

def season
  @season
end

Instance Method Details

#line_outObject



18
19
20
# File 'lib/ehbrs_ruby_utils/videos/series/rename/season_group.rb', line 18

def line_out
  'Season: '.cyan + "#{season} (#{first_episode} - #{last_episode})"
end

#show(level) ⇒ Object



22
23
24
25
# File 'lib/ehbrs_ruby_utils/videos/series/rename/season_group.rb', line 22

def show(level)
  super
  files.each { |file| file.show(level + 1) }
end