Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created July 22, 2015 15:36
Class foo
def bar ()
# Prints "Yes"
if ( /(?<=bodyContent=\').*(?=\')/ =~ message )
puts "Yes"
else
puts "No"
end
@body_data = /(?<=bodyContent=\').*(?=\')/.match(message)
puts body_data # undefined local variable or method `body_data' for ... NameError
def other ()
# Do something with body_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment