Class: Fitting::Configuration::Yaml

Inherits:
Object
  • Object
show all
Defined in:
lib/fitting/configuration/yaml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml, title = 'fitting') ⇒ Yaml

Returns a new instance of Yaml.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fitting/configuration/yaml.rb', line 22

def initialize(yaml, title = 'fitting')
  @apib_path = yaml['apib_path']
  @drafter_yaml_path = yaml['drafter_yaml_path']
  @crafter_apib_path = yaml['crafter_apib_path']
  @crafter_yaml_path = yaml['crafter_yaml_path']
  @drafter_4_apib_path = yaml['drafter_4_apib_path']
  @drafter_4_yaml_path = yaml['drafter_4_yaml_path']
  @tomogram_json_path = yaml['tomogram_json_path']
  @strict = yaml['strict']
  @prefix = yaml['prefix']
  @white_list = yaml['white_list']
  @resource_white_list = yaml['resource_white_list']
  @ignore_list = yaml['ignore_list']
  @include_resources = yaml['include_resources']
  @include_actions = yaml['include_actions']
  @title = title
  default
end

Instance Attribute Details

#apib_pathObject

Returns the value of attribute apib_path.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def apib_path
  @apib_path
end

#crafter_apib_pathObject

Returns the value of attribute crafter_apib_path.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def crafter_apib_path
  @crafter_apib_path
end

#crafter_yaml_pathObject

Returns the value of attribute crafter_yaml_path.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def crafter_yaml_path
  @crafter_yaml_path
end

#drafter_4_apib_pathObject

Returns the value of attribute drafter_4_apib_path.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def drafter_4_apib_path
  @drafter_4_apib_path
end

#drafter_4_yaml_pathObject

Returns the value of attribute drafter_4_yaml_path.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def drafter_4_yaml_path
  @drafter_4_yaml_path
end

#drafter_yaml_pathObject

Returns the value of attribute drafter_yaml_path.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def drafter_yaml_path
  @drafter_yaml_path
end

#ignore_listObject

Returns the value of attribute ignore_list.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def ignore_list
  @ignore_list
end

#include_actionsObject

Returns the value of attribute include_actions.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def include_actions
  @include_actions
end

#include_resourcesObject

Returns the value of attribute include_resources.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def include_resources
  @include_resources
end

#prefixObject

Returns the value of attribute prefix.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def prefix
  @prefix
end

#resource_white_listObject

Returns the value of attribute resource_white_list.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def resource_white_list
  @resource_white_list
end

#strictObject

Returns the value of attribute strict.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def strict
  @strict
end

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/fitting/configuration/yaml.rb', line 6

def title
  @title
end

#tomogram_json_pathObject

Returns the value of attribute tomogram_json_path.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def tomogram_json_path
  @tomogram_json_path
end

#white_listObject

Returns the value of attribute white_list.



7
8
9
# File 'lib/fitting/configuration/yaml.rb', line 7

def white_list
  @white_list
end

Instance Method Details

#not_covered_pathObject



72
73
74
75
76
77
78
# File 'lib/fitting/configuration/yaml.rb', line 72

def not_covered_path
  if @title == 'fitting'
    'fitting/not_covered'
  else
    "fitting/#{@title}/not_covered"
  end
end

#stats_pathObject



64
65
66
67
68
69
70
# File 'lib/fitting/configuration/yaml.rb', line 64

def stats_path
  if @title == 'fitting'
    'fitting/stats'
  else
    "fitting/#{@title}/stats"
  end
end

#tomogramObject



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fitting/configuration/yaml.rb', line 41

def tomogram
  @tomogram ||= if @crafter_yaml_path || @crafter_apib_path
                  Tomograph::Tomogram.new(
                    prefix: @prefix,
                    crafter_apib_path: @crafter_apib_path,
                    crafter_yaml_path: @crafter_yaml_path,
                  )
                elsif @drafter_4_apib_path || @drafter_4_yaml_path
                  Tomograph::Tomogram.new(
                    prefix: @prefix,
                    drafter_4_apib_path: @drafter_4_apib_path,
                    drafter_4_yaml_path: @drafter_4_yaml_path,
                  )
                else
                  Tomograph::Tomogram.new(
                    prefix: @prefix,
                    apib_path: @apib_path,
                    drafter_yaml_path: @drafter_yaml_path,
                    tomogram_json_path: @tomogram_json_path
                  )
                end
end