Sha256: d6118160910a8a9dfb4ddce2dcdcc3113135e744cb7a4aa49d3154b0cb33c711

Contents?: true

Size: 680 Bytes

Versions: 4

Compression:

Stored size: 680 Bytes

Contents

#= require trix/core/basic_object

class Trix.Object extends Trix.BasicObject
  id = 0

  @fromJSONString: (jsonString) ->
    @fromJSON JSON.parse(jsonString)

  constructor: ->
    @id = ++id

  hasSameConstructorAs: (object) ->
    @constructor is object?.constructor

  isEqualTo: (object) ->
    this is object

  inspect: ->
    contents = for key, value of @contentsForInspection() ? {}
      "#{key}=#{value}"

    "#<#{@constructor.name}:#{@id}#{if contents.length then " #{contents.join(", ")}" else ""}>"

  contentsForInspection: ->

  toJSONString: ->
    JSON.stringify(this)

  toUTF16String: ->
    Trix.UTF16String.box(this)

  getCacheKey: ->
    @id.toString()

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vapid-0.1.3 lib/vapid/vendor/trix/src/trix/core/object.coffee
vapid-0.1.2 lib/vapid/vendor/trix/src/trix/core/object.coffee
vapid-0.1.1 lib/vapid/vendor/trix/src/trix/core/object.coffee
vapid-0.1.0 lib/vapid/vendor/trix/src/trix/core/object.coffee