Sha256: ed95d544ee500eb67b2d7108a6ccc5e9c0574c404147788e109a73ce32c03ac9

Contents?: true

Size: 561 Bytes

Versions: 21

Compression:

Stored size: 561 Bytes

Contents

module RailsConnector

class Version
  def initialize(doc)
    @doc = doc
  end

  def obj_id
    @doc["obj_id"]
  end

  def revision_id
    @doc["revision_id"]
  end

  def diff
    if @doc["content_cache_id"]
      case @doc["action"]
      when "D"
        0
      else # "N", "E"
        1
      end
    else
      @doc["diff"]
    end
  end

  def obj_data(patch_diff)
    data = patch_diff < 0 ? @doc["before"] : @doc["current"]
    data["obj_id"] = @doc["obj_id"]
    data["obj_type"] = @doc["obj_type"]

    data
  end
end

end # module RailsConnector

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
infopark_cloud_connector-6.8.3.115.227021242 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.3.73.75172665 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.3.2.153416031 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.3.67.110847540 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.3.1.23895778 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.2.36.82613853 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.2.7.128454143 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.1.26.236500544 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.1 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.539.93842523 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.529.114081979 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.518.30999728 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.515.34928522 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.498.46559598 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.480.261594408 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.444.171626367 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.406.131718077 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.356.19698103 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.348.160665197 lib/rails_connector/version.rb
infopark_cloud_connector-6.8.0.328.4a753fc lib/rails_connector/version.rb