Class: Story

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(attributes = {}) ⇒ Story

Returns a new instance of Story.



16
17
18
19
20
# File 'lib/pivotal-tracker/story.rb', line 16

def initialize(attributes = {})
  attributes.each do |key, value|
    send("#{key}=", value)
  end
end

Instance Method Details

#to_paramObject



31
32
33
# File 'lib/pivotal-tracker/story.rb', line 31

def to_param
  id.to_s
end

#to_xml(options = {}) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/pivotal-tracker/story.rb', line 22

def to_xml(options = {})
  builder = Builder::XmlMarkup.new(options)
  builder.story do |story|
    story.id   id.to_s   if id
    story.type type.to_s if type
    story.name name.to_s if name
  end
end