Sha256: 4a66bf3b490fe7dd20ea204ff086856f8a7ee7fde4378b74e548f3df7e2c9c5d

Contents?: true

Size: 556 Bytes

Versions: 1

Compression:

Stored size: 556 Bytes

Contents

class App.Validators.Base
  @sharedInstances = {}

  @instance: (obj, attr, opts) ->
    validatorName = this.name
    if not @sharedInstances[validatorName]?
      @sharedInstances[validatorName] = new App.Validators[validatorName]
    sharedInstance = @sharedInstances[validatorName]
    sharedInstance.assignAttribs obj, attr, opts
    return sharedInstance

  constructor: ->
    @obj = null
    @attr = null
    @val = null
    @opts = null

  assignAttribs: (obj, attr, opts) ->
    @obj = obj
    @attr = attr
    @val = @obj[@attr]
    @opts = opts

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 lib/assets/javascripts/loco/validators/base.coffee