Skip to content

Instantly share code, notes, and snippets.

@seven1m
Forked from bayleedev/broke.rb
Last active December 16, 2015 07:29

Revisions

  1. seven1m revised this gist Apr 16, 2013. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions broke.rb
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,10 @@
    class Foo
    class << self
    private
    def self.bar
    puts 'I broke your ruby'
    def bar
    puts 'I did not broke your ruby'
    end
    end
    end

    Foo.bar # I broke your ruby
    Foo.bar # NoMethodError: private method `bar' called for Foo:Class
  2. Blaine Schmeisser created this gist Apr 16, 2013.
    8 changes: 8 additions & 0 deletions broke.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    class Foo
    private
    def self.bar
    puts 'I broke your ruby'
    end
    end

    Foo.bar # I broke your ruby