templates/saga/helpers.rb in saga-0.2.0 vs templates/saga/helpers.rb in saga-0.3.0
- old
+ new
@@ -2,6 +2,20 @@
def format_author(author)
[:name, :email, :company, :website].map do |key|
author[key]
end.compact.join(', ')
end
+
+ def format_story(story)
+ story_attributes = []
+ story_attributes << "##{story[:id]}" if story[:id]
+ story_attributes << "##{story[:status]}" if story[:status]
+
+ parts = [[story[:description], story_attributes.join(' ')].join(' - ')]
+ parts << " #{story[:notes]}" if story[:notes]
+ parts.join("\n\n")
+ end
+
+ def format_definition(definition)
+ [definition[:title], definition[:definition]].join(': ')
+ end
end
\ No newline at end of file