module PDF module Storycards # The string Story#narrative is imbued with a method called to_sentence, which formats the # story narrative as a single sentence without newlines. class Story def initialize(title, narrative) @meta_data = {} @title = title @narrative = narrative def @narrative.to_sentence self.sub(/^\s*I want/, ", I want").gsub(/^\s*So that/, ", so that").split($/).join(" ").gsub(' ,',',').squeeze(" ") end @scenarios = [] end attr_reader :title, :narrative attr_accessor :meta_data def add_scenario(scenario) @scenarios << scenario end def current_scenario @scenarios.last end end end end