Class: TaskMapper::Provider::Unfuddle::Ticket
- Inherits:
-
Base::Ticket
- Object
- Base::Ticket
- TaskMapper::Provider::Unfuddle::Ticket
- Defined in:
- lib/provider/ticket.rb
Overview
Ticket class for taskmapper-unfuddle
Constant Summary collapse
- API =
The class to access the api’s tickets
UnfuddleAPI::Ticket
Instance Method Summary collapse
- #assignee ⇒ Object
- #created_at ⇒ Object
-
#initialize(*options) ⇒ Ticket
constructor
declare needed overloaded methods here.
- #requestor ⇒ Object
- #title ⇒ Object
- #updated_at ⇒ Object
Constructor Details
#initialize(*options) ⇒ Ticket
declare needed overloaded methods here
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/provider/ticket.rb', line 10 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] end end |
Instance Method Details
#assignee ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/provider/ticket.rb', line 35 def assignee @assignee ||= begin UnfuddleAPI::People.find(self[:assignee_id]).username rescue '' end end |
#created_at ⇒ Object
27 28 29 |
# File 'lib/provider/ticket.rb', line 27 def created_at @created_at ||= self[:created_at] ? Time.parse(self[:created_at]) : nil end |
#requestor ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/provider/ticket.rb', line 43 def requestor @requestor ||= begin UnfuddleAPI::People.find(self[:reporter_id]).username rescue '' end end |
#title ⇒ Object
23 24 25 |
# File 'lib/provider/ticket.rb', line 23 def title self.summary end |
#updated_at ⇒ Object
31 32 33 |
# File 'lib/provider/ticket.rb', line 31 def updated_at @updated_at ||= self[:updated_at] ? Time.parse(self[:updated_at]) : nil end |