Sha256: 3bbb3cbe524877abb3eb4ed5a478fb4f4ace984e6faeca2e662e50c5a7bfa3ca

Contents?: true

Size: 351 Bytes

Versions: 23

Compression:

Stored size: 351 Bytes

Contents

u = up.util

class up.Record

  fields: ->
    throw 'Return an array of property names'

  constructor: (options) ->
    u.assign(@, @attributes(options))

  attributes: (source = @) =>
    u.only(source, @fields()...)

  copy: (changes = {}) =>
    attributesWithChanges = u.merge(@attributes(), changes)
    new @constructor(attributesWithChanges)

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
unpoly-rails-0.56.7 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.56.6 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.56.5 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.56.4 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.56.3 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.56.2 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.56.1 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.56.0 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.55.1 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.55.0 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.54.1 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.54.0 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.53.4 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.53.3 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.53.2 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.53.1 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.53.0 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.52.0 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.51.1 lib/assets/javascripts/unpoly/classes/record.coffee
unpoly-rails-0.51.0 lib/assets/javascripts/unpoly/classes/record.coffee