Class: UnfuddleMyEmail::EmailTicket

Inherits:
Object
  • Object
show all
Defined in:
lib/unfuddle_my_email/email_ticket.rb

Overview

Create an XML formatted ticket.

Expects an object that responds to the following methods:

  • subject: The summary for the ticket

  • from: An array of authors

  • body: Will be added the the ticket description

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ EmailTicket



14
15
16
# File 'lib/unfuddle_my_email/email_ticket.rb', line 14

def initialize(message)
  @message = message
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



12
13
14
# File 'lib/unfuddle_my_email/email_ticket.rb', line 12

def message
  @message
end

Instance Method Details

#to_xmlObject

Returns an XML representation of an Unfuddle ticket.



20
21
22
23
24
25
26
27
# File 'lib/unfuddle_my_email/email_ticket.rb', line 20

def to_xml
  builder = Builder::XmlMarkup.new
  return xml = builder.ticket { |ticket|
    ticket.priority    "1"
    ticket.summary     subject
    ticket.description description
  }
end