Sha256: 694595b1c711c57127f946fc5c43f3dd275c1c00ca12486376b4fec2e8288930

Contents?: true

Size: 675 Bytes

Versions: 2

Compression:

Stored size: 675 Bytes

Contents

class RMXFirebaseTableViewCell < RMXTableViewCell

  extend RMXFirebaseHandleModel

  def prepareForReuse
    if @data
      @data_unbinder.call if @data_unbinder
      @data_unbinder = nil
    end
    @data = nil
    reset
  end

  def reset
  end

  def changed
  end

  def data=(val)
    return @data if val == @data
    @data = val
    if @data
      unless @data.ready?
        raise "#{className} tried to use a model that is not ready: #{@data.inspect}"
      end
      @data_unbinder = @data.always do |m|
        next unless m == @data
        changed
      end
    end
    @data
  end

  def model
    @data
  end

  def model=(val)
    self.data = val
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

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