class KayakoClient::KnowledgebaseAttachment

Public Instance Methods

contents() click to toggle source
# File lib/kayako_client/knowledgebase_attachment.rb, line 43
def contents
    if instance_variable_defined?(:@contents)
        instance_variable_get(:@contents)
    elsif !new? && id && kb_article_id && id > 0 && kb_article_id > 0
        logger.debug "contents are missing - trying to reload" if logger
        if reload!(:e => "#{self.class.path}/#{kb_article_id.to_i}/#{id.to_i}") && instance_variable_defined?(:@contents)
            instance_variable_get(:@contents)
        else
            instance_variable_set(:@contents, nil)
        end
    else
        nil
    end
end