On Nov 12, 2007 1:21 PM, 7stud -- <bbxx789_05ss / yahoo.com> wrote:
> class Dog
>   def Dog.bark
>     puts  'Woof'
>   end
>
>   def self.speak
>     puts 'I am a Dog.'
>   end
>
>   class <<Dog
>     def run
>       puts "Run run"
>     end
>   end
>
>   class <<self
>     def growl
>       puts "Grrrrr"
>     end
>   end
>
> end
>
>
> class <<Dog
>   def sayhi
>     puts 'hi'
>   end
> end
>
> Dog.bark
> Dog.speak
> Dog.run
> Dog.growl
> Dog.sayhi
>
> --output:--
> Woof
> I am a Dog.
> Run run
> Grrrrr
>

class C
  class << self
    def f
      puts "hi"
    end
  end
  def f
    puts "bye"
  end
end

c = C.new
c.f
C.f
c.f == C.f

Todd