Skip to content

Commit 99af161

Browse files
djalmaaraujoclaude
andcommitted
style: fix standard rubocop offenses in data_table components
Use anonymous block forwarding (&) and tr instead of gsub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bbf958c commit 99af161

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/ruby_ui/data_table/data_table.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def initialize(src: nil, **attrs)
77
super(**attrs)
88
end
99

10-
def view_template(&block)
11-
div(**attrs, &block)
10+
def view_template(&)
11+
div(**attrs, &)
1212
end
1313

1414
private

lib/ruby_ui/data_table/data_table_content.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def initialize(frame_id: "data_table_content", **attrs)
77
super(**attrs)
88
end
99

10-
def view_template(&block)
11-
div(id: @frame_id, **attrs, &block)
10+
def view_template(&)
11+
div(id: @frame_id, **attrs, &)
1212
end
1313

1414
private

lib/ruby_ui/data_table/data_table_sortable_header.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module RubyUI
44
class DataTableSortableHeader < Base
55
def initialize(column:, label: nil, direction: nil, **attrs)
66
@column = column
7-
@label = label || column.to_s.gsub("_", " ").capitalize
7+
@label = label || column.to_s.tr("_", " ").capitalize
88
@direction = direction # nil, "asc", or "desc"
99
super(**attrs)
1010
end

lib/ruby_ui/data_table/data_table_toolbar.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
module RubyUI
44
class DataTableToolbar < Base
5-
def view_template(&block)
6-
div(**attrs, &block)
5+
def view_template(&)
6+
div(**attrs, &)
77
end
88

99
private

0 commit comments

Comments
 (0)