Class: CucumberToHtml::Cell::Feature
- Inherits:
-
Cucumberhtml::Cell
- Object
- Trailblazer::Cell
- Cucumberhtml::Cell
- CucumberToHtml::Cell::Feature
- Defined in:
- app/concepts/cucumber_to_html/cell/feature.rb
Instance Method Summary collapse
- #active ⇒ Object
- #description ⇒ Object
- #element(element) ⇒ Object
- #element_list ⇒ Object
- #feature ⇒ Object
- #feature_classes ⇒ Object
- #feature_id ⇒ Object
- #feature_menu_item ⇒ Object
- #menu_classes ⇒ Object
- #name ⇒ Object
Instance Method Details
#active ⇒ Object
13 14 15 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 13 def active [:active] end |
#description ⇒ Object
33 34 35 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 33 def description Kramdown::Document.new(model['description']).to_html end |
#element(element) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 41 def element(element) case element['keyword'] when 'Scenario' Scenario.call(element).call when 'Background' Element.call(element).call if element == element_list[0] when 'Scenario Outline' ScenarioOutline.call(element).call else raise "Unknown element: #{element['keyword']}" end end |
#element_list ⇒ Object
37 38 39 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 37 def element_list model['elements'] end |
#feature ⇒ Object
5 6 7 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 5 def feature model end |
#feature_classes ⇒ Object
17 18 19 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 17 def feature_classes 'show active' if active end |
#feature_id ⇒ Object
25 26 27 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 25 def feature_id "list-#{model['id']}" end |
#feature_menu_item ⇒ Object
9 10 11 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 9 def render :feature_menu_item end |
#menu_classes ⇒ Object
21 22 23 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 21 def "list-group-item list-group-item-action #{'active' if active}" end |
#name ⇒ Object
29 30 31 |
# File 'app/concepts/cucumber_to_html/cell/feature.rb', line 29 def name model['name'] end |