Class: Sirportly::TicketUpdate

Inherits:
DataObject show all
Defined in:
lib/sirportly/data_objects/ticket_update.rb

Instance Attribute Summary

Attributes inherited from DataObject

#attributes, #client

Instance Method Summary collapse

Methods inherited from DataObject

all, find, #initialize, #inspect, #method_missing

Constructor Details

This class inherits a constructor from Sirportly::DataObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sirportly::DataObject

Instance Method Details

#authorObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/sirportly/data_objects/ticket_update.rb', line 4

def author
  if author = self.attributes['author']
    if author.keys.include?('reference') && author.keys.include?('abbreviated_name') && author.keys.include?('pin')
      Customer.new(client, author)
    else
      User.new(client, author)
    end
  else
    nil
  end
end