Class: Spec::Story::StoryBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/rspec-1.1.11/spec/spec/story/builders.rb

Instance Method Summary collapse

Constructor Details

#initializeStoryBuilder

Returns a new instance of StoryBuilder.



4
5
6
7
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 4

def initialize
  @title = 'a story'
  @narrative = 'narrative'
end

Instance Method Details

#narrative(value) ⇒ Object



14
15
16
17
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 14

def narrative(value)
  @narrative = value
  self
end

#title(value) ⇒ Object



9
10
11
12
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 9

def title(value)
  @title = value
  self
end

#to_story(&block) ⇒ Object



19
20
21
22
# File 'lib/gems/rspec-1.1.11/spec/spec/story/builders.rb', line 19

def to_story(&block)
  block = lambda {} unless block_given?
  Story.new @title, @narrative, &block
end