Class: Inch::Config::Base

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language) ⇒ Base

Returns a new instance of Base


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

def initialize(language)
  @language = language.to_sym
end

Instance Attribute Details

#languageObject (readonly)

Returns the value of attribute language


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

def language
  @language
end

Instance Method Details

#codebase(&block) ⇒ Object


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

def codebase(&block)
  @codebase ||= Config::Codebase.new(@language)
  @codebase.update(&block) if block
  @codebase
end

#evaluation(&block) ⇒ Object


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

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

#update(&block) ⇒ Object


13
14
15
16
# File 'lib/inch/config/base.rb', line 13

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