Skip to content

Commit

Permalink
Add a comment to #compile_strings_for_equivalent_method to make it mo…
Browse files Browse the repository at this point in the history
…re clear
  • Loading branch information
dkubb committed Apr 2, 2012
1 parent dc8c031 commit ebcf135
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/virtus/value_object/equalizer.rb
Expand Up @@ -102,12 +102,15 @@ def hash
#
# @api private
def compile_strings_for_equivalent_method
@keys.map { |key|
respond_to_and_equivalence = @keys.map do |key|
[
"other.respond_to?(#{key.inspect})", # for #respond_to?
"#{key} == other.#{key}", # for #==
]
}.transpose
end

# transpose the instructions into two arrays
respond_to_and_equivalence.transpose
end

# @api private
Expand Down

0 comments on commit ebcf135

Please sign in to comment.