Class: Fitting::Configuration::Yaml
- Inherits:
-
Object
- Object
- Fitting::Configuration::Yaml
- Defined in:
- lib/fitting/configuration/yaml.rb
Instance Attribute Summary collapse
-
#apib_path ⇒ Object
Returns the value of attribute apib_path.
-
#crafter_apib_path ⇒ Object
Returns the value of attribute crafter_apib_path.
-
#crafter_yaml_path ⇒ Object
Returns the value of attribute crafter_yaml_path.
-
#drafter_4_apib_path ⇒ Object
Returns the value of attribute drafter_4_apib_path.
-
#drafter_4_yaml_path ⇒ Object
Returns the value of attribute drafter_4_yaml_path.
-
#drafter_yaml_path ⇒ Object
Returns the value of attribute drafter_yaml_path.
-
#ignore_list ⇒ Object
Returns the value of attribute ignore_list.
-
#include_actions ⇒ Object
Returns the value of attribute include_actions.
-
#include_resources ⇒ Object
Returns the value of attribute include_resources.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#resource_white_list ⇒ Object
Returns the value of attribute resource_white_list.
-
#strict ⇒ Object
Returns the value of attribute strict.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#tomogram_json_path ⇒ Object
Returns the value of attribute tomogram_json_path.
-
#white_list ⇒ Object
Returns the value of attribute white_list.
Instance Method Summary collapse
-
#initialize(yaml, title = 'fitting') ⇒ Yaml
constructor
A new instance of Yaml.
- #not_covered_path ⇒ Object
- #stats_path ⇒ Object
- #tomogram ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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_list ⇒ Object
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_actions ⇒ Object
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_resources ⇒ Object
Returns the value of attribute include_resources.
7 8 9 |
# File 'lib/fitting/configuration/yaml.rb', line 7 def include_resources @include_resources end |
#prefix ⇒ Object
Returns the value of attribute prefix.
7 8 9 |
# File 'lib/fitting/configuration/yaml.rb', line 7 def prefix @prefix end |
#resource_white_list ⇒ Object
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 |
#strict ⇒ Object
Returns the value of attribute strict.
7 8 9 |
# File 'lib/fitting/configuration/yaml.rb', line 7 def strict @strict end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'lib/fitting/configuration/yaml.rb', line 6 def title @title end |
#tomogram_json_path ⇒ Object
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_list ⇒ Object
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_path ⇒ Object
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_path ⇒ Object
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 |
#tomogram ⇒ Object
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 |