Skip to content

Commit

Permalink
Style/YodaCondition: Reverse the order of the operands
Browse files Browse the repository at this point in the history
  • Loading branch information
jlduran committed Feb 18, 2023
1 parent 4f1ff18 commit 75a6928
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def one?
end

def thousand?
FiguresArray::THOUSAND_CAPACITY == @current_capacity
@current_capacity == FiguresArray::THOUSAND_CAPACITY
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def one?
end

def thousand?
FiguresArray::THOUSAND_CAPACITY == @current_capacity
@current_capacity == FiguresArray::THOUSAND_CAPACITY
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def one?
end

def thousand?
FiguresArray::THOUSAND_CAPACITY == @current_capacity
@current_capacity == FiguresArray::THOUSAND_CAPACITY
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def hundreds_number_to_words
end

def capacity_iteration
return super if FiguresArray::THOUSAND_CAPACITY != @current_capacity
return super if @current_capacity != FiguresArray::THOUSAND_CAPACITY
return [] if apply_tens_of_hundreds?
return megs if figures.number_in_capacity(@current_capacity) == 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def one?
end

def thousand?
FiguresArray::THOUSAND_CAPACITY == @current_capacity
@current_capacity == FiguresArray::THOUSAND_CAPACITY
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Ordinal < Base::Ordinal

def result(type)
@type = type
MEGS_TYPE == type ? check_megs_numbers : check_simple_numbers
type == MEGS_TYPE ? check_megs_numbers : check_simple_numbers
end

private
Expand All @@ -27,8 +27,8 @@ def check_megs_numbers

def simple_numbers_condition
current_capacity.nil? &&
(HUNDRED_TYPE != @type ||
(HUNDRED_TYPE == @type && simple_number_to_words.empty?))
(@type != HUNDRED_TYPE ||
(@type == HUNDRED_TYPE && simple_number_to_words.empty?))
end

def megs_numbers_condition
Expand Down

0 comments on commit 75a6928

Please sign in to comment.