Class: Creek::Styles

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#bookObject

Returns the value of attribute book.



5
6
7
# File 'lib/creek/styles.rb', line 5

def book
  @book
end

Instance Method Details

#pathObject



10
11
12
# File 'lib/creek/styles.rb', line 10

def path
  "xl/styles.xml"
end

#style_typesObject



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_xmlObject



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