Skip to content

Commit

Permalink
Auto corrected by following Lint Ruby Style/ParallelAssignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Awesome Code committed Jan 17, 2021
1 parent 0c95f63 commit ca4f72c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/synvert/core/rewriter.rb
Expand Up @@ -49,7 +49,8 @@ class <<self
# @param name [String] the unique rewriter name.
# @param rewriter [Synvert::Core::Rewriter] the rewriter to register.
def register(group, name, rewriter)
group, name = group.to_s, name.to_s
group = group.to_s
name = name.to_s
rewriters[group] ||= {}
rewriters[group][name] = rewriter
end
Expand All @@ -61,7 +62,8 @@ def register(group, name, rewriter)
# @return [Synvert::Core::Rewriter] the matching rewriter.
# @raise [Synvert::Core::RewriterNotFound] if the registered rewriter is not found.
def fetch(group, name)
group, name = group.to_s, name.to_s
group = group.to_s
name = name.to_s
if exist? group, name
rewriters[group][name]
else
Expand All @@ -76,7 +78,8 @@ def fetch(group, name)
# @return [Synvert::Core::Rewriter] the registered rewriter.
# @raise [Synvert::Core::RewriterNotFound] if the registered rewriter is not found.
def call(group, name)
group, name = group.to_s, name.to_s
group = group.to_s
name = name.to_s
if exist? group, name
rewriter = rewriters[group][name]
rewriter.process
Expand All @@ -92,7 +95,8 @@ def call(group, name)
# @param name [String] the rewriter name.
# @return [Boolean] true if the rewriter exist.
def exist?(group, name)
group, name = group.to_s, name.to_s
group = group.to_s
name = name.to_s
if rewriters[group] && rewriters[group][name]
true
else
Expand Down

0 comments on commit ca4f72c

Please sign in to comment.