Class: Creek::Styles
- Inherits:
-
Object
- Object
- Creek::Styles
- Defined in:
- lib/creek/styles.rb,
lib/creek/styles/constants.rb,
lib/creek/styles/converter.rb,
lib/creek/styles/style_types.rb
Defined Under Namespace
Modules: Constants Classes: Converter, StyleTypes
Instance Attribute Summary collapse
-
#book ⇒ Object
Returns the value of attribute book.
Instance Method Summary collapse
-
#initialize(book) ⇒ Styles
constructor
A new instance of Styles.
- #path ⇒ Object
- #style_types ⇒ Object
- #styles_xml ⇒ Object
Constructor Details
#initialize(book) ⇒ Styles
Returns a new instance of Styles.
4 5 6 |
# File 'lib/creek/styles.rb', line 4 def initialize(book) @book = book end |
Instance Attribute Details
#book ⇒ Object
Returns the value of attribute book.
3 4 5 |
# File 'lib/creek/styles.rb', line 3 def book @book end |
Instance Method Details
#path ⇒ Object
8 9 10 |
# File 'lib/creek/styles.rb', line 8 def path "xl/styles.xml" end |
#style_types ⇒ Object
21 22 23 24 25 |
# File 'lib/creek/styles.rb', line 21 def style_types @style_types ||= begin Creek::Styles::StyleTypes.new(styles_xml).call end end |
#styles_xml ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/creek/styles.rb', line 12 def styles_xml @styles_xml ||= begin if @book.files.file.exist?(path) doc = @book.files.file.open path Nokogiri::XML::Document.parse doc end end end |