Class: Fitting::Report::Prefix

Inherits:
Object
  • Object
show all
Defined in:
lib/fitting/report/prefix.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, tomogram_json_path, skip = false) ⇒ Prefix

Returns a new instance of Prefix.



6
7
8
9
10
11
12
13
14
# File 'lib/fitting/report/prefix.rb', line 6

def initialize(name, tomogram_json_path, skip = false)
  @name = name
  @tomogram_json_path = tomogram_json_path
  @tests = Fitting::Report::Tests.new([])
  @skip = skip
  unless skip
    @actions = Fitting::Report::Actions.new(name, tomogram_json_path)
  end
end

Instance Method Details

#actionsObject



28
29
30
# File 'lib/fitting/report/prefix.rb', line 28

def actions
  @actions
end

#add_test(test) ⇒ Object



48
49
50
# File 'lib/fitting/report/prefix.rb', line 48

def add_test(test)
  @tests.push(test)
end

#detailsObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fitting/report/prefix.rb', line 32

def details
  if @skip
    {
        name: @name,
        tests_size: @tests.size,
        actions: {tests_without_actions: [], actions_details: []}
    }
  else
    {
        name: @name,
        tests_size: @tests.size,
        actions: @actions.details(self)
    }
  end
end

#nameObject



16
17
18
# File 'lib/fitting/report/prefix.rb', line 16

def name
  @name
end

#skip?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/fitting/report/prefix.rb', line 24

def skip?
  @skip
end

#testsObject



20
21
22
# File 'lib/fitting/report/prefix.rb', line 20

def tests
  @tests
end