Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Optimizing Default conversions
  • Loading branch information
Fred-JulieDesk committed Jun 17, 2016
commit c797728c8d2e96bbeedd950f268a871f0013de6c
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ rdoc
*.sqlite3
*.gem
.ruby-*
.idea/
8 changes: 5 additions & 3 deletions lib/stringex/localization/default_conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ module DefaultConversions
}

class << self
%w{characters currencies html_entities transliterations vulgar_fractions}.each do |conversion_type|
define_method conversion_type do
const_get conversion_type.upcase
# %w{characters currencies html_entities transliterations vulgar_fractions}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [83/80]


[['characters'.freeze, 'CHARACTERS'.freeze], ['currencies'.freeze, 'CURRENCIES'.freeze], ['html_entities'.freeze, 'HTML_ENTITIES'.freeze], ['transliterations'.freeze, 'TRANSLITERATIONS'.freeze], ['vulgar_fractions'.freeze, 'VULGAR_FRACTIONS'.freeze]].each do |conversion_type|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [284/80]
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

define_method conversion_type[0] do
const_get conversion_type[1]
end
end
end
Expand Down