class TicketSharing::Comment

Public Class Methods

new(params={}) click to toggle source
Calls superclass method TicketSharing::Base::new
# File lib/ticket_sharing/comment.rb, line 11
def initialize(params={})
  self.public = true

  super(params)

  if Hash === author
    self.author = Actor.new(author)
  end
end
parse(json) click to toggle source
# File lib/ticket_sharing/comment.rb, line 21
def self.parse(json)
  attributes = JsonSupport.decode(json)
  new(attributes)
end

Public Instance Methods

attachments=(attachments) click to toggle source
# File lib/ticket_sharing/comment.rb, line 30
def attachments=(attachments)
  @attachments = attachments && attachments.map do |attachment|
    attachment.is_a?(Attachment) ? attachment : Attachment.new(attachment)
  end
end
authored_at=(value) click to toggle source
# File lib/ticket_sharing/comment.rb, line 26
def authored_at=(value)
  @authored_at = TicketSharing::Time.new(value)
end
public?() click to toggle source
# File lib/ticket_sharing/comment.rb, line 36
def public?
  self.public
end