Sha256: 1f10cabbb39afc282b890ddc3daa66faed556b2eef456e22a5c25516da978e66

Contents?: true

Size: 807 Bytes

Versions: 2

Compression:

Stored size: 807 Bytes

Contents

class RMXFirebaseViewController < RMXViewController

  extend RMXFirebaseHandleModel

  def viewDidLoad
    s = super
    if @pending_changed
      @pending_changed = nil
      if @model
        changed
      end
    end
    s
  end

  def changed
  end

  def model
    @model
  end

  def model=(val)
    return @model if @model == val
    if @model
      @model_unbinder.call if @model_unbinder
      @model_unbinder = nil
    end
    @model = val
    if @model
      unless @model.ready?
        raise "#{className} tried to use a model that is not ready: #{@model.inspect}"
      end
      @model_unbinder = @model.always do |m|
        next unless m == @model
        if isViewLoaded
          changed
        else
          @pending_changed = true
        end
      end
    end
    @model
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rmx-firebase-0.0.3 lib/motion/RMXFirebaseViewController.rb
rmx-firebase-0.0.2 lib/motion/RMXFirebaseViewController.rb