Class: SystemTester::Step
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- SystemTester::Step
- Includes:
- TitleValidatable
- Defined in:
- app/models/system_tester/step.rb
Constant Summary collapse
- INDENT =
" " * 6
Class Method Summary collapse
- .args ⇒ Object
- .bg_css ⇒ Object
- .friendly_type ⇒ Object
- .leafs ⇒ Object
- .parent_type ⇒ Object
- .parent_types ⇒ Object
- .text_css ⇒ Object
Instance Method Summary collapse
Class Method Details
.args ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'app/models/system_tester/step.rb', line 64 def self.args [ { name: 'arg_one', label: 'One', type: 'text' }, { name: 'arg_two', label: 'Two', type: 'text' } ] end |
.bg_css ⇒ Object
36 37 38 |
# File 'app/models/system_tester/step.rb', line 36 def self.bg_css "teal" end |
.friendly_type ⇒ Object
28 29 30 |
# File 'app/models/system_tester/step.rb', line 28 def self.friendly_type name.demodulize end |
.leafs ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'app/models/system_tester/step.rb', line 79 def self.leafs (descendants - direct_descendants).map do |desc| { name: desc.to_s, friendly: desc.friendly_type, parent: desc.parent_type, args: desc.args } end.sort_by { |step_type| [step_type[:parent_type], step_type[:friendly]] } end |
.parent_type ⇒ Object
32 33 34 |
# File 'app/models/system_tester/step.rb', line 32 def self.parent_type ancestors.fourth.name ? ancestors.fourth.name.demodulize : "Step" end |
.parent_types ⇒ Object
90 91 92 93 94 95 96 97 |
# File 'app/models/system_tester/step.rb', line 90 def self.parent_types direct_descendants.map do |desc| { name: desc.to_s, friendly: desc.friendly_type } end.sort_by { |step_type| step_type[:friendly] } end |
.text_css ⇒ Object
40 41 42 |
# File 'app/models/system_tester/step.rb', line 40 def self.text_css "white-text" end |
Instance Method Details
#bg_css ⇒ Object
52 53 54 |
# File 'app/models/system_tester/step.rb', line 52 def bg_css self.class.bg_css end |
#friendly_type ⇒ Object
44 45 46 |
# File 'app/models/system_tester/step.rb', line 44 def friendly_type self.class.friendly_type end |
#module ⇒ Object
60 61 62 |
# File 'app/models/system_tester/step.rb', line 60 def module "" end |
#parent_type ⇒ Object
48 49 50 |
# File 'app/models/system_tester/step.rb', line 48 def parent_type self.class.parent_type end |
#text_css ⇒ Object
56 57 58 |
# File 'app/models/system_tester/step.rb', line 56 def text_css self.class.text_css end |