This commit is contained in:
darthjee
2024-07-29 16:01:40 -03:00
parent 8f26e7f148
commit 19bbae5dd8
2 changed files with 2 additions and 8 deletions

View File

@@ -6,12 +6,6 @@
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again. # versions of RuboCop, may require this file to be generated again.
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapToHash:
Exclude:
- 'source/font_helper/font.rb'
# Offense count: 2 # Offense count: 2
# This cop supports safe autocorrection (--autocorrect). # This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.

View File

@@ -9,9 +9,9 @@ class FontHelper
def initialize(width, height, characters = nil) def initialize(width, height, characters = nil)
@width = width @width = width
@height = height @height = height
@characters = characters.map do |character| @characters = characters.to_h do |character|
[character.code, character] [character.code, character]
end.to_h end
end end
def <<(character) def <<(character)