"Mark Volkmann" <volkmann2 / charter.net> wrote in
....
> What is the purpose of "self." below?
>
> module Foo
>     def self.bar()
>         # some code goes here
>     end
> end
>

module  Foo
    p self   # => Foo

    # in other words
    #     def self.bar()
    #        # some code goes here
    #     end
    # is equivalent to
    def  Foo.bar ...
        # same code goes here
    end
end

# or up to scope
 def Foo.bar
      # same code goes here
end


# The lattter defines a singleton method for the Module
# object Foo and can be called as

    Foo.bar


/Christoph