Skip to content

Instantly share code, notes, and snippets.

@irridescentrambler
Created September 11, 2019 12:34
Show Gist options
  • Save irridescentrambler/ad125d8b190a48f9bf2e67b87019c698 to your computer and use it in GitHub Desktop.
Save irridescentrambler/ad125d8b190a48f9bf2e67b87019c698 to your computer and use it in GitHub Desktop.
[1,2,3,4,5].method(:length).source_location
#=> nil
"Ruby".method(:concat).source_location
#=> nil
class Array
def subset?(sub_array)
sub_array.each do |element|
return false unless self.include?(element)
end
true
end
end
[1,2,3,4].method(:subset?).source_location
#=> ['source_location_demo_1.rb', 8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment