Skip to content

Instantly share code, notes, and snippets.

@damaon
Last active January 8, 2016 10:50
Show Gist options
  • Save damaon/27335b8b5d86ff62fd08 to your computer and use it in GitHub Desktop.
Save damaon/27335b8b5d86ff62fd08 to your computer and use it in GitHub Desktop.
rails c
irb(main):011:0> rr = Rack::Request.new({})
=> #<Rack::Request:0x007fb6a11193d8 @env={}>
irb(main):012:0> rr.method(:location).source
=> " def location\n @location ||= Geocoder.search(geocoder_spoofable_ip, ip_address: true).first\n end\n"
irb(main):003:0> rr.method(:location).source_location
=> ["/Users/damiantrojnar/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/geocoder-1.2.14/lib/geocoder/request.rb", 8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment