Class: EpubForge::Builder::Assets::Image
- Defined in:
- lib/epubforge/builder/assets/image.rb
Instance Attribute Summary collapse
-
#ext ⇒ Object
readonly
Returns the value of attribute ext.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #cover? ⇒ Boolean
-
#initialize(filename, options = {}) ⇒ Image
constructor
A new instance of Image.
- #item_id ⇒ Object
- #link ⇒ Object
Methods inherited from Asset
Constructor Details
#initialize(filename, options = {}) ⇒ Image
Returns a new instance of Image.
6 7 8 9 |
# File 'lib/epubforge/builder/assets/image.rb', line 6 def initialize( filename, = {} ) @filename = filename.fwf_filepath @name, @ext = @filename.basename_and_ext end |
Instance Attribute Details
#ext ⇒ Object (readonly)
Returns the value of attribute ext.
5 6 7 |
# File 'lib/epubforge/builder/assets/image.rb', line 5 def ext @ext end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
5 6 7 |
# File 'lib/epubforge/builder/assets/image.rb', line 5 def filename @filename end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/epubforge/builder/assets/image.rb', line 5 def name @name end |
Instance Method Details
#cover? ⇒ Boolean
19 20 21 |
# File 'lib/epubforge/builder/assets/image.rb', line 19 def cover? self.name == "cover" end |
#item_id ⇒ Object
15 16 17 |
# File 'lib/epubforge/builder/assets/image.rb', line 15 def item_id cover? ? "cover-image" : self.link.basename end |
#link ⇒ Object
11 12 13 |
# File 'lib/epubforge/builder/assets/image.rb', line 11 def link IMAGE_DIR.join( "#{@name}.#{@ext}" ) end |