Class: RMXFirebaseTableViewCell

Inherits:
RMXTableViewCell
  • Object
show all
Extended by:
RMXFirebaseHandleModel
Defined in:
lib/motion/RMXFirebaseTableViewCell.rb

Instance Method Summary collapse

Methods included from RMXFirebaseHandleModel

handle

Instance Method Details

#changedObject



17
18
# File 'lib/motion/RMXFirebaseTableViewCell.rb', line 17

def changed
end

#data=(val) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/motion/RMXFirebaseTableViewCell.rb', line 20

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

#modelObject



35
36
37
# File 'lib/motion/RMXFirebaseTableViewCell.rb', line 35

def model
  @data
end

#model=(val) ⇒ Object



39
40
41
# File 'lib/motion/RMXFirebaseTableViewCell.rb', line 39

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

#prepareForReuseObject



5
6
7
8
9
10
11
12
# File 'lib/motion/RMXFirebaseTableViewCell.rb', line 5

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

#resetObject



14
15
# File 'lib/motion/RMXFirebaseTableViewCell.rb', line 14

def reset
end