class TableSettings::Row

Attributes

id[R]

Public Class Methods

new(row_id) click to toggle source
# File lib/table_settings/table_button.rb, line 57
def initialize(row_id)
  @id = row_id
  @buttons = []
end

Public Instance Methods

add_button(label, url_path = nil) { |button| ... } click to toggle source
# File lib/table_settings/table_button.rb, line 62
def add_button(label, url_path = nil)
  button = TableSettings::Button.new(@id, label, url_path)
  yield(button) if block_given?
  @buttons << button
  button
end
data() click to toggle source
# File lib/table_settings/table_button.rb, line 69
def data
  if @buttons.empty?
    {}
  elsif @buttons.size == 1
    @buttons[0].hash
  else  @buttons.size > 1
    @buttons.collect { |button| button.hash }
  end

end