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.
6 7 8 |
# File 'lib/creek/styles.rb', line 6 def initialize(book) @book = book end |
Instance Attribute Details
#book ⇒ Object
Returns the value of attribute book.
5 6 7 |
# File 'lib/creek/styles.rb', line 5 def book @book end |
Instance Method Details
#path ⇒ Object
10 11 12 |
# File 'lib/creek/styles.rb', line 10 def path "xl/styles.xml" end |
#style_types ⇒ Object
23 24 25 26 27 |
# File 'lib/creek/styles.rb', line 23 def style_types @style_types ||= begin Creek::Styles::StyleTypes.new(styles_xml).call end end |
#styles_xml ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/creek/styles.rb', line 14 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 |