lib/freshbooks/oauth2_rest_client.rb
def document
      unless @document
        @document = self.class.unserialize(data, @client.media_type)
        @key, @document = @document[0], @document[1] if @client.media_type == "application/json"
      end
      @document
    end
# replace these REST::Resource methods so they support XML or JSON
replace these REST::Resource methods so they support XML or JSON
replace these REST :: Resource methods so they support XML or JSON
def document
      unless @document
        @document = self.class.unserialize(data, @client.media_type)
        @key, @document = @document[0], @document[1] if @client.media_type == "application/json"
      end
      @document
    end
def document unless @document @document = self . class . unserialize ( data , @client . media_type ) @key , @document = @document [ 0 ] , @document [ 1 ] if @client . media_type == "application/json" end @document end
replace these REST::Resource methods so they support XML or JSON
replace these REST :: Resource methods so they support XML or JSON