Class: Taeval::Unittest::Config

Inherits:
Object
  • Object
show all
Includes:
FileHelper
Defined in:
lib/taeval/unittest/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileHelper

#create, #exist?, #flatten_include!, #open, #path_of

Constructor Details

#initialize(conf_h) ⇒ Config

Returns a new instance of Config.



9
10
11
12
13
14
15
16
17
# File 'lib/taeval/unittest/config.rb', line 9

def initialize(conf_h)
  @tool      = conf_h.dig('build', 'tool')
  @cmd       = conf_h.dig('build', 'cmd')
  @original  = path_of(conf_h.fetch('original', ''))
  if !File.exist?(@original)
    raise "Unittest: #{@original} does not exist"
  end
  @solutions = path_of(conf_h.dig('solution', 'path'))
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



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

def cmd
  @cmd
end

#originalObject (readonly)

Returns the value of attribute original.



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

def original
  @original
end

#solutionsObject (readonly)

Returns the value of attribute solutions.



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

def solutions
  @solutions
end

#toolObject (readonly)

Returns the value of attribute tool.



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

def tool
  @tool
end