class BaseRow

Attributes

key[R]
label[R]
options[R]

Public Class Methods

new(key, options) click to toggle source
# File lib/project/rows/base_row.rb, line 4
def initialize(key, options)
  @key     = key
  @options = options

  @label = options.fetch(:label, key.to_s.titleize)
end

Public Instance Methods

cell_identifier() click to toggle source
# File lib/project/rows/base_row.rb, line 27
def cell_identifier
  cell_type::IDENTIFIER
end
dealloc() click to toggle source
# File lib/project/rows/base_row.rb, line 23
def dealloc
  notification_center.removeObserver(self)
end
has_value?() click to toggle source
# File lib/project/rows/base_row.rb, line 31
def has_value?
  cell_type.has_value?
end
notification_center() click to toggle source
# File lib/project/rows/base_row.rb, line 11
def notification_center
  NSNotificationCenter.defaultCenter
end
observe(notification_name, selector) click to toggle source
# File lib/project/rows/base_row.rb, line 19
def observe(notification_name, selector)
  notification_center.addObserver(self, selector: selector, name: notification_name, object: nil)
end
post(notification) click to toggle source
# File lib/project/rows/base_row.rb, line 15
def post(notification)
  notification_center.postNotificationName(notification, object: self, userInfo: nil)
end
update_cell(cell) click to toggle source
# File lib/project/rows/base_row.rb, line 35
def update_cell(cell)
  cell.key         = key
  cell.label       = label
  cell.placeholder = options.fetch(:placeholder, nil)
end