Class: Inch::Config

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

Overview

Stores the configuration for Inch

See Also:

  • config/defaultsconfig/defaults.rb

Defined Under Namespace

Classes: Evaluation

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.instanceObject

Returns the value of attribute instance.



7
8
9
# File 'lib/inch/config.rb', line 7

def instance
  @instance
end

Class Method Details

.run(&block) ⇒ Object



9
10
11
12
13
# File 'lib/inch/config.rb', line 9

def run(&block)
  self.instance ||= new
  instance.update(&block)
  instance
end

Instance Method Details

#development!Object



24
25
26
# File 'lib/inch/config.rb', line 24

def development!
  @development = true
end

#development?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/inch/config.rb', line 20

def development?
  @development
end

#evaluation(&block) ⇒ Object



28
29
30
31
32
# File 'lib/inch/config.rb', line 28

def evaluation(&block)
  @evaluation ||= Evaluation.new
  @evaluation.update(&block) if block
  @evaluation
end

#update(&block) ⇒ Object



16
17
18
# File 'lib/inch/config.rb', line 16

def update(&block)
  instance_eval(&block)
end