Class: TicketMaster::Provider::Mingle::Comment

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

Overview

The comment class for ticketmaster-mingle

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

MingleAPI::Comment

Instance Method Summary collapse

Constructor Details

#initialize(*object) ⇒ Comment

declare needed overloaded methods here



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/provider/comment.rb', line 12

def initialize(*object)
  if object.first
    object = object.first
    @system_data = {:client => object}
    unless object.is_a? Hash
      hash = {:content => object.content,
              :created_at => object.created_at,
              :created_by => object.created_by,
              :ticket_id => object.prefix_options[:number],
              :project_id => object.prefix_options[:identifier]}
    else
      hash = object
    end
    super hash
  end
end

Instance Method Details

#created_atObject



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

def created_at
  self[:created_at]
end

#created_byObject



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

def created_by
  self[:created_by]
end

#project_idObject



37
38
39
# File 'lib/provider/comment.rb', line 37

def project_id
  self[:identifier]
end

#ticket_idObject



41
42
43
# File 'lib/provider/comment.rb', line 41

def ticket_id
  self[:number]
end