Class: EpubForge::Builder::Assets::Stylesheet

Inherits:
Asset
  • Object
show all
Defined in:
lib/epubforge/builder/assets/stylesheet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Asset

#cover?

Constructor Details

#initialize(filename) ⇒ Stylesheet

Returns a new instance of Stylesheet.



6
7
8
9
10
# File 'lib/epubforge/builder/assets/stylesheet.rb', line 6

def initialize( filename )
  @filename = filename.fwf_filepath
  @name     = @filename.basename
  @contents = @filename.read
end

Instance Attribute Details

#contentsObject

Returns the value of attribute contents.



5
6
7
# File 'lib/epubforge/builder/assets/stylesheet.rb', line 5

def contents
  @contents
end

#filenameObject

Returns the value of attribute filename.



5
6
7
# File 'lib/epubforge/builder/assets/stylesheet.rb', line 5

def filename
  @filename
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/epubforge/builder/assets/stylesheet.rb', line 5

def name
  @name
end

Instance Method Details

#item_idObject



16
17
18
# File 'lib/epubforge/builder/assets/stylesheet.rb', line 16

def item_id
  @name
end


12
13
14
# File 'lib/epubforge/builder/assets/stylesheet.rb', line 12

def link
  STYLE_DIR.join( @name )
end

#media_typeObject



20
21
22
# File 'lib/epubforge/builder/assets/stylesheet.rb', line 20

def media_type
  MEDIA_TYPES["css"]
end