Class: Story
- Inherits:
-
Object
- Object
- Story
- Includes:
- HappyMapper
- Defined in:
- lib/pivotal-tracker.rb,
lib/pivotal-tracker/story.rb
Overview
initial definition, to avoid circular dependencies when declaring happymappings
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Story
constructor
A new instance of Story.
- #to_param ⇒ Object
- #to_xml(options = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Story
Returns a new instance of Story.
18 19 20 21 22 |
# File 'lib/pivotal-tracker/story.rb', line 18 def initialize(attributes = {}) attributes.each do |key, value| send("#{key}=", value) end end |
Instance Method Details
#to_param ⇒ Object
34 35 36 |
# File 'lib/pivotal-tracker/story.rb', line 34 def to_param id.to_s end |
#to_xml(options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/pivotal-tracker/story.rb', line 24 def to_xml( = {}) builder = Builder::XmlMarkup.new() builder.story do |story| Story.elements.each do |element_type| element = send(element_type.name) eval("story.#{element_type.name}(\"#{element.to_s.gsub("\"", "\\\"")}\")") if element end end end |