Class: Fitting::Report::Prefix
- Inherits:
-
Object
- Object
- Fitting::Report::Prefix
- Defined in:
- lib/fitting/report/prefix.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Instance Method Summary collapse
- #add_test(test) ⇒ Object
- #details ⇒ Object
-
#initialize(name: '', openapi2_json_path: nil, openapi3_yaml_path: nil, drafter_yaml_path: nil, tomogram_json_path: nil, crafter_yaml_path: nil, skip: false) ⇒ Prefix
constructor
A new instance of Prefix.
- #skip? ⇒ Boolean
Constructor Details
#initialize(name: '', openapi2_json_path: nil, openapi3_yaml_path: nil, drafter_yaml_path: nil, tomogram_json_path: nil, crafter_yaml_path: nil, skip: false) ⇒ Prefix
Returns a new instance of Prefix.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fitting/report/prefix.rb', line 6 def initialize(name: '', openapi2_json_path: nil, openapi3_yaml_path: nil, drafter_yaml_path: nil, tomogram_json_path: nil, crafter_yaml_path: nil, skip: false) @name = name @tomogram_json_path = tomogram_json_path @tests = Fitting::Report::Tests.new([]) @skip = skip return if skip @actions = if openapi2_json_path Fitting::Report::Actions.new( Tomograph::Tomogram.new( prefix: name, openapi2_json_path: openapi2_json_path ) ) elsif openapi3_yaml_path Fitting::Report::Actions.new( Tomograph::Tomogram.new( prefix: name, openapi3_yaml_path: openapi3_yaml_path ) ) elsif drafter_yaml_path Fitting::Report::Actions.new( Tomograph::Tomogram.new( prefix: name, drafter_yaml_path: drafter_yaml_path ) ) elsif crafter_yaml_path Fitting::Report::Actions.new( Tomograph::Tomogram.new( prefix: name, crafter_yaml_path: crafter_yaml_path ) ) else Fitting::Report::Actions.new( Tomograph::Tomogram.new( prefix: name, tomogram_json_path: tomogram_json_path ) ) end end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
52 53 54 |
# File 'lib/fitting/report/prefix.rb', line 52 def actions @actions end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
52 53 54 |
# File 'lib/fitting/report/prefix.rb', line 52 def name @name end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
52 53 54 |
# File 'lib/fitting/report/prefix.rb', line 52 def tests @tests end |
Instance Method Details
#add_test(test) ⇒ Object
74 75 76 |
# File 'lib/fitting/report/prefix.rb', line 74 def add_test(test) @tests.push(test) end |
#details ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/fitting/report/prefix.rb', line 58 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 |
#skip? ⇒ Boolean
54 55 56 |
# File 'lib/fitting/report/prefix.rb', line 54 def skip? @skip end |