Class: Webcomics2::Dir

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(series_path) ⇒ Dir

Returns a new instance of Dir.



65
66
67
# File 'lib/wc2_dir.rb', line 65

def initialize(series_path)
  @series_path = series_path
end

Class Method Details

.alpha_chapters(series_path) ⇒ Array

Returns an array of all the directories within this series path that only consist of letters.

Parameters:

  • series_path (String)

    Path to the series.

Returns:

  • (Array)

    Comic book pages.



48
49
50
# File 'lib/wc2_dir.rb', line 48

def self.alpha_chapters(series_path)
  return_an_array_of_alpha_chapters(series_path)
end

.chapter?(series_path) ⇒ Boolean

Returns true if the series path is considered a chapter/directory.

Parameters:

  • series_path (String)

    Path to the series.

Returns:

  • (Boolean)


25
26
27
# File 'lib/wc2_dir.rb', line 25

def self.chapter?(series_path)
  is_this_series_path_a_chapter?(series_path)
end

.comics_entries(series_path) ⇒ Array

Returns entries from the series path without the previous or current directories.

Parameters:

  • series_path (String)

    Path to the series.

Returns:

  • (Array)

    Entries.



10
11
12
# File 'lib/wc2_dir.rb', line 10

def self.comics_entries(series_path)
  return_an_array_of_comics_entries(series_path)
end

.no_ext(pages) ⇒ Array

Returns an array of pages without file extentions.

Parameters:

  • pages (String)

    Filenames or pages.

Returns:

  • (Array)

    Entries.



18
19
20
# File 'lib/wc2_dir.rb', line 18

def self.no_ext(pages)
  return_comics_entries_without_file_extentions(pages)
end

.numeric_chapters(series_path) ⇒ Array

Returns an array of all the numeric directories within this series path.

Parameters:

  • series_path (String)

    Path to the series.

Returns:

  • (Array)

    Comic book pages.



56
57
58
# File 'lib/wc2_dir.rb', line 56

def self.numeric_chapters(series_path)
  return_an_array_of_numeric_chapters(series_path)
end

.page?(series_path) ⇒ Boolean

Returns true if the series path is considered a page/file.

Parameters:

  • series_path (String)

    Path to the series.

Returns:

  • (Boolean)


32
33
34
# File 'lib/wc2_dir.rb', line 32

def self.page?(series_path)
  is_this_series_path_a_page?(series_path)
end

.pages(series_path) ⇒ Array

Returns an array of what is considered comic book pages/files.

Parameters:

  • series_path (String)

    Path to the series.

Returns:

  • (Array)

    Comic book pages.



40
41
42
# File 'lib/wc2_dir.rb', line 40

def self.pages(series_path)
  return_an_array_of_comics_pages(series_path)
end

.series_have_chapters?(series_path) ⇒ Boolean

Returns true if the comic book series has chapters.

Returns:

  • (Boolean)


61
62
63
# File 'lib/wc2_dir.rb', line 61

def self.series_have_chapters?(series_path)
  does_this_series_have_chapters?(series_path)
end

Instance Method Details

#alpha_chaptersArray

Returns an array of all the directories within this series path that only consist of letters.

Returns:

  • (Array)

    Comic book pages.



96
97
98
# File 'lib/wc2_dir.rb', line 96

def alpha_chapters
  Dir.alpha_chapters(@series_path)
end

#chapter?Boolean

Returns true if the series path is considered a chapter/directory.

Returns:

  • (Boolean)


77
78
79
# File 'lib/wc2_dir.rb', line 77

def chapter?
  Dir.chapter?(@series_path)
end

#numeric_chaptersArray

Returns an array of all the numeric directories within this series path.

Returns:

  • (Array)

    Comic book pages.



103
104
105
# File 'lib/wc2_dir.rb', line 103

def numeric_chapters
  Dir.numeric_chapters(@series_path)
end

#page?Boolean

Returns true if the series path is considered a page/file.

Returns:

  • (Boolean)


82
83
84
# File 'lib/wc2_dir.rb', line 82

def page?
  Dir.page?(@series_path)
end

#pagesArray

Returns an array of what is considered comic book pages/files.

Returns:

  • (Array)

    Comic book pages.



89
90
91
# File 'lib/wc2_dir.rb', line 89

def pages
  Dir.pages(@series_path)
end

#series_have_chapters?Boolean

Returns true if the comic book series has chapters.

Returns:

  • (Boolean)


108
109
110
# File 'lib/wc2_dir.rb', line 108

def series_have_chapters?
  Dir.series_have_chapters?(@series_path)
end

#series_pathString Also known as: path

Returns the path.

Returns:

  • (String)

    The series path.



72
73
74
# File 'lib/wc2_dir.rb', line 72

def series_path
  @series_path
end