Class: PDF::Storycards::StoryCapturingMediator
- Inherits:
-
Object
- Object
- PDF::Storycards::StoryCapturingMediator
- Defined in:
- lib/pdf/storycards/story_capturing_mediator.rb
Instance Attribute Summary collapse
-
#stories ⇒ Object
readonly
Returns the value of attribute stories.
Instance Method Summary collapse
- #create_given(name) ⇒ Object
- #create_given_scenario(name) ⇒ Object
- #create_scenario(title) ⇒ Object
- #create_story(title, narrative) ⇒ Object
- #create_then(name) ⇒ Object
- #create_when(name) ⇒ Object
-
#initialize ⇒ StoryCapturingMediator
constructor
A new instance of StoryCapturingMediator.
Constructor Details
#initialize ⇒ StoryCapturingMediator
Returns a new instance of StoryCapturingMediator.
8 9 10 |
# File 'lib/pdf/storycards/story_capturing_mediator.rb', line 8 def initialize @stories = [] end |
Instance Attribute Details
#stories ⇒ Object (readonly)
Returns the value of attribute stories.
12 13 14 |
# File 'lib/pdf/storycards/story_capturing_mediator.rb', line 12 def stories @stories end |
Instance Method Details
#create_given(name) ⇒ Object
22 23 24 |
# File 'lib/pdf/storycards/story_capturing_mediator.rb', line 22 def create_given(name) current_scenario.add_step Step.new('Given', name) end |
#create_given_scenario(name) ⇒ Object
26 27 28 |
# File 'lib/pdf/storycards/story_capturing_mediator.rb', line 26 def create_given_scenario(name) current_scenario.add_step Step.new('GivenScenario', name) end |
#create_scenario(title) ⇒ Object
18 19 20 |
# File 'lib/pdf/storycards/story_capturing_mediator.rb', line 18 def create_scenario(title) current_story.add_scenario Scenario.new(title) end |
#create_story(title, narrative) ⇒ Object
14 15 16 |
# File 'lib/pdf/storycards/story_capturing_mediator.rb', line 14 def create_story(title, narrative) @stories << Story.new(title, narrative) end |