Class: RBehave::Story

Inherits:
Object
  • Object
show all
Defined in:
lib/rbehave/story.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, narrative, &body) ⇒ Story

Returns a new instance of Story.



5
6
7
8
9
# File 'lib/rbehave/story.rb', line 5

def initialize(title, narrative, &body)
  @body = body
  @title = title
  @narrative = narrative
end

Instance Attribute Details

#narrativeObject (readonly)

Returns the value of attribute narrative.



3
4
5
# File 'lib/rbehave/story.rb', line 3

def narrative
  @narrative
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/rbehave/story.rb', line 3

def title
  @title
end

Instance Method Details

#run_in(container) ⇒ Object



11
12
13
# File 'lib/rbehave/story.rb', line 11

def run_in(container)
  container.instance_eval(&@body)
end