Class: Paperwork::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/paperwork/config.rb

Overview

paperwork configuration

currently available options are:

:build_root     build directory [default: .work]
:bundle_jobs    number of jobs for bundle install [default: 8]
:verbose        verbose middleman build [default: false]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



15
16
17
18
19
20
21
22
23
# File 'lib/paperwork/config.rb', line 15

def initialize
    self.options = {
        build_root: ".work",
        bundle_jobs: 8,
        verbose: false,
        custom_css: [],
        custom_js: []
    }
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



13
14
15
# File 'lib/paperwork/config.rb', line 13

def options
  @options
end

Class Method Details

.[](key) ⇒ Object



33
34
35
# File 'lib/paperwork/config.rb', line 33

def self.[](key)
    self.instance[key]
end

.[]=(key, value) ⇒ Object



37
38
39
# File 'lib/paperwork/config.rb', line 37

def self.[]=(key, value)
    self.instance[key] = value
end

.instanceObject



41
42
43
# File 'lib/paperwork/config.rb', line 41

def self.instance
    @@instance ||= self.new
end

Instance Method Details

#[](key) ⇒ Object



25
26
27
# File 'lib/paperwork/config.rb', line 25

def [](key)
    self.options[key]
end

#[]=(key, value) ⇒ Object



29
30
31
# File 'lib/paperwork/config.rb', line 29

def []=(key, value)
    self.options[key] = value
end