Class: Note
- Inherits:
-
Object
- Object
- Note
- Includes:
- HappyMapper
- Defined in:
- lib/pivotal-tracker.rb,
lib/pivotal-tracker/note.rb
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Note
constructor
A new instance of Note.
- #to_param ⇒ Object
- #to_xml(options = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Note
Returns a new instance of Note.
9 10 11 12 13 |
# File 'lib/pivotal-tracker/note.rb', line 9 def initialize(attributes = {}) attributes.each do |key, value| send("#{key}=", value) end end |
Instance Method Details
#to_param ⇒ Object
25 26 27 |
# File 'lib/pivotal-tracker/note.rb', line 25 def to_param id.to_s end |
#to_xml(options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/pivotal-tracker/note.rb', line 15 def to_xml( = {}) builder = Builder::XmlMarkup.new() builder.note do |note| Note.elements.each do |element_type| element = send(element_type.name) eval("note.#{element_type.name}(\"#{element.to_s.gsub("\"", "\\\"")}\")") if element end end end |