amatriain / feedbunch

A simple and elegant feed reader.
http://feedbunch.com
MIT License
84 stars 11 forks source link

Fix private method definitions #12

Closed yogodoshi closed 8 years ago

yogodoshi commented 8 years ago

In Ruby, private doesn't work if you are defining a method on an explicity object, self in these cases.

There were 2 ways to fix that (that I know about), defining the methods with:

class << self
    private
      def foo
        "bar"
      end
  end

And the one that I prefer: calling private_class_method after each private method definition or define them all on a single private_class_method.

More about this strange Ruby behavior here: http://stackoverflow.com/questions/4952980/creating-private-class-method

yogodoshi commented 8 years ago

To fix the bundler-audit warnings: #13

amatriain commented 8 years ago

I just learned about this ruby quirk while looking at your other PR. I may have never found out if you didn't point it out. Weird :)

yogodoshi commented 8 years ago

@amatriain yup, it's very weird indeed but for some people it makes sens =s

amatriain commented 8 years ago

This is now merged into master: see commits cebeb0d26c447c479f1fde4e6753dd54be25f8a9, 616c65bfb7f10610b9228531c36fc3c3c2afe596 and 688f94eea9128b96d1ab37ae94a9210138f35657.

I think github does not allow using the "merge PR" button after I've added some commits to your PR, but it's in the commit history all the same.

Thanks for your help fixing private class methods!