Class: TaskMapper::Provider::Unfuddle::Comment
- Inherits:
-
Base::Comment
- Object
- Base::Comment
- TaskMapper::Provider::Unfuddle::Comment
- Defined in:
- lib/provider/comment.rb
Overview
The comment class for taskmapper-unfuddle
Do any mapping between TaskMapper and your system’s comment model here versions of the ticket.
Constant Summary collapse
- API =
The class to access the api’s comments
UnfuddleAPI::Comment
Instance Method Summary collapse
- #author ⇒ Object
- #created_at ⇒ Object
-
#initialize(*options) ⇒ Comment
constructor
declare needed overloaded methods here.
- #updated_at ⇒ Object
Constructor Details
#initialize(*options) ⇒ Comment
declare needed overloaded methods here
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/provider/comment.rb', line 12 def initialize(*) @system_data ||= {} @cache ||= {} first = .shift case first when Hash super first.to_hash else @system_data[:client] = first super first.attributes.merge!( :project_id => first.[:project_id], :ticket_id => first.[:ticket_id]) end end |
Instance Method Details
#author ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/provider/comment.rb', line 27 def @author ||= begin UnfuddleAPI::People.find(self[:author_id]).username rescue '' end end |
#created_at ⇒ Object
35 36 37 |
# File 'lib/provider/comment.rb', line 35 def created_at @created_at ||= self[:created_at] ? Time.parse(self[:created_at]) : nil end |
#updated_at ⇒ Object
39 40 41 |
# File 'lib/provider/comment.rb', line 39 def updated_at @updated_at ||= self[:updated_at] ? Time.parse(self[:updated_at]) : nil end |