lib/pdf/storycards/story.rb in pdf-storycards-0.0.1 vs lib/pdf/storycards/story.rb in pdf-storycards-0.1.0
- old
+ new
@@ -1,17 +1,21 @@
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_accessor :title, :narrative
+ attr_reader :title, :narrative
+ attr_accessor :meta_data
def add_scenario(scenario)
@scenarios << scenario
end
\ No newline at end of file