Class: TableSettings::Row
- Inherits:
-
Object
- Object
- TableSettings::Row
- Defined in:
- lib/table_settings/table_button.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #add_button(label, url_path = nil) {|button| ... } ⇒ Object
- #data ⇒ Object
-
#initialize(row_id) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(row_id) ⇒ Row
57 58 59 60 |
# File 'lib/table_settings/table_button.rb', line 57 def initialize(row_id) @id = row_id = [] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
55 56 57 |
# File 'lib/table_settings/table_button.rb', line 55 def id @id end |
Instance Method Details
#add_button(label, url_path = nil) {|button| ... } ⇒ Object
62 63 64 65 66 67 |
# File 'lib/table_settings/table_button.rb', line 62 def (label, url_path = nil) = TableSettings::Button.new(@id, label, url_path) yield() if block_given? << end |
#data ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# File 'lib/table_settings/table_button.rb', line 69 def data if .empty? {} elsif .size == 1 [0].hash else .size > 1 .collect { || .hash } end end |