Skip to content

Instantly share code, notes, and snippets.

@xenda
Created August 25, 2011 21:18
Show Gist options
  • Save xenda/1172000 to your computer and use it in GitHub Desktop.
Save xenda/1172000 to your computer and use it in GitHub Desktop.
# Original
(self.index('"') == 2 || self.index("'") == 2) ? true : false
# First iteration
[self.index('"'),self.index("'")].include? 2 ? true : false
# Second iteration
[self.index('"'),self.index("'")].include? 2 # de por sí ya eso retorna true o false
# Third iteration, self isn't needed
[index('"'),index("'")].include? 2
def third_char_symbol?
[index('"'), index("'")].include? 2
end
puts "Hey!" if third_char_symbol?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment