Class: TicketMaster::Provider::Unfuddle::Comment

Inherits:
Base::Comment
  • Object
show all
Defined in:
lib/provider/comment.rb

Overview

The comment class for ticketmaster-unfuddle

Do any mapping between Ticketmaster 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

Instance Method Details

#authorObject

declare needed overloaded methods here



12
13
14
15
16
17
18
# File 'lib/provider/comment.rb', line 12

def author
  @author ||= begin
    UnfuddleAPI::People.find(self[:author_id]).username
    rescue
    ''
    end
end

#created_atObject



20
21
22
# File 'lib/provider/comment.rb', line 20

def created_at
  @created_at ||= self[:created_at] ? Time.parse(self[:created_at]) : nil
end

#project_idObject



28
29
30
# File 'lib/provider/comment.rb', line 28

def project_id
  self.prefix_options[:project_id]
end

#ticket_idObject



32
33
34
# File 'lib/provider/comment.rb', line 32

def ticket_id
  self.prefix_options[:ticket_id]
end

#updated_atObject



24
25
26
# File 'lib/provider/comment.rb', line 24

def updated_at
  @updated_at ||= self[:updated_at] ? Time.parse(self[:updated_at]) : nil
end