Get Method Name as String in Python
Here is how to get the string representation of a method in Python def my_method_name(): print "Hello World" my_method_name.__name__ # => 'my_method_name' Short and sweet!
Written by Sean Behan on 03/04/2017
Simple String Concatenation of a Collection Written as a Helper for Rails
At Railsconf last week I took Greg Pollack's online course Rails Best Practices. The interface is gorgeous and the instructions are excellent. One of the lessons involved taking a partial and moving it into a helper. I was reminded how difficult such a si...
Written by Sean Behan on 06/17/2012
Using Module Mixins to Extend Classes and Objects in Ruby
The module and class below demonstrate how to use instance methods and class methods from "module mixins". The thing to remember is scope. For instance, to use class methods within instance methods you need to call them from the class itself. This is acco...
Written by Sean Behan on 06/17/2012