Skip to content

Instantly share code, notes, and snippets.

@terrbear
Created October 5, 2011 16:29
Show Gist options
  • Save terrbear/1264928 to your computer and use it in GitHub Desktop.
Save terrbear/1264928 to your computer and use it in GitHub Desktop.
class JiraTicket
def hello_there
"hello there"
end
end
jt = JiraTicket.new
puts "hello there: #{jt.hello_there}"
JiraTicket.class_eval do
def bye_bye
"bye bye!"
end
end
puts "jt has it? #{jt.respond_to?(:bye_bye)}"
puts "what about jt2? #{JiraTicket.new.respond_to?(:bye_bye)}"
#output:
#hello there: hello there
#jt has it? true
#what about jt2? true
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment