module KayakoClient::CreatorAPI
Public Instance Methods
created_by_staff?()
click to toggle source
# File lib/kayako_client/mixins/creator_api.rb, line 18 def created_by_staff? !creator_type.nil? && creator_type == self.class::CREATOR_STAFF end
created_by_user?()
click to toggle source
# File lib/kayako_client/mixins/creator_api.rb, line 22 def created_by_user? !creator_type.nil? && creator_type == self.class::CREATOR_USER end
creator()
click to toggle source
# File lib/kayako_client/mixins/creator_api.rb, line 26 def creator if @associated.has_key?(:creator) @associated[:creator] elsif instance_variable_defined?(:@creator_id) creator_id = instance_variable_get(:@creator_id) if created_by_staff? @associated[:creator] = Staff.get(creator_id.to_i, inherited_options) elsif created_by_user? @associated[:creator] = User.get(creator_id.to_i, inherited_options) else @associated[:creator] = nil end else @associated[:creator] = nil end end