Class: Makimono::Configuration
- Inherits:
-
Object
- Object
- Makimono::Configuration
- Extended by:
- Forwardable
- Defined in:
- lib/makimono/configuration.rb
Constant Summary collapse
- DEFAULTS =
{ # Makimono source: File.('src'), output: File.('out'), style: nil, template: 'default.xhtml', markdown: 'CommonMarker', converters: %w[Markdown], generator: 'EPUB', ebook_file_name: 'book', library: File.('lib'), # EPUB identifier: "urn:uuid:#{SecureRandom.uuid}", title: 'No title', language: 'ja' }.freeze
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #style ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ Configuration
Returns a new instance of Configuration.
32 33 34 |
# File 'lib/makimono/configuration.rb', line 32 def initialize(config = {}) @config = DEFAULTS.merge(config) end |
Instance Method Details
#style ⇒ Object
40 41 42 43 44 45 46 47 48 |
# File 'lib/makimono/configuration.rb', line 40 def style return @style if defined? @style @style = if @config[:style].nil? || @config[:style].empty? nil else Style.from_style_config(@config[:style]) end end |
#to_h ⇒ Object
36 37 38 |
# File 'lib/makimono/configuration.rb', line 36 def to_h @config end |