Class: ComicBook::Entry
- Inherits:
-
Object
- Object
- ComicBook::Entry
- Defined in:
- lib/comic_book/entry.rb
Overview
A single member of a comic book: an image, an info file (ComicInfo.xml / MetronInfo.xml), or anything else.
‘path` locates it within the comic:
a relative path in a folder,
or an entry name in an archive
‘name` is its basename.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #image? ⇒ Boolean
- #info? ⇒ Boolean
-
#initialize(path) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(path) ⇒ Entry
Returns a new instance of Entry.
12 13 14 15 |
# File 'lib/comic_book/entry.rb', line 12 def initialize path @path = path @name = File.basename path end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/comic_book/entry.rb', line 10 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/comic_book/entry.rb', line 10 def path @path end |
Instance Method Details
#image? ⇒ Boolean
17 |
# File 'lib/comic_book/entry.rb', line 17 def image? = ComicBook::IMAGE_EXTENSIONS.include?(File.extname(name).downcase) |
#info? ⇒ Boolean
18 |
# File 'lib/comic_book/entry.rb', line 18 def info? = ComicBook::INFO_FILENAMES.include?(name) |