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
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'app/models/system_tester/step.rb', line 55 def self.args [ { name: 'arg_one', label: 'One', type: 'text' }, { name: 'arg_two', label: 'Two', type: 'text' } ] end |
.bg_css ⇒ Object
27 28 29 |
# File 'app/models/system_tester/step.rb', line 27 def self.bg_css "teal" end |
.friendly_type ⇒ Object
19 20 21 |
# File 'app/models/system_tester/step.rb', line 19 def self.friendly_type name.demodulize end |
.leafs ⇒ Object
70 71 72 73 74 75 76 77 78 79 |
# File 'app/models/system_tester/step.rb', line 70 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
23 24 25 |
# File 'app/models/system_tester/step.rb', line 23 def self.parent_type ancestors.fourth.name.demodulize end |
.parent_types ⇒ Object
81 82 83 84 85 86 87 88 |
# File 'app/models/system_tester/step.rb', line 81 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
31 32 33 |
# File 'app/models/system_tester/step.rb', line 31 def self.text_css "white-text" end |
Instance Method Details
#bg_css ⇒ Object
43 44 45 |
# File 'app/models/system_tester/step.rb', line 43 def bg_css self.class.bg_css end |
#friendly_type ⇒ Object
35 36 37 |
# File 'app/models/system_tester/step.rb', line 35 def friendly_type self.class.friendly_type end |
#module ⇒ Object
51 52 53 |
# File 'app/models/system_tester/step.rb', line 51 def module "" end |
#parent_type ⇒ Object
39 40 41 |
# File 'app/models/system_tester/step.rb', line 39 def parent_type self.class.parent_type end |
#text_css ⇒ Object
47 48 49 |
# File 'app/models/system_tester/step.rb', line 47 def text_css self.class.text_css end |