Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:08:22+00:00 2026-06-03T01:08:22+00:00

Some interesting output from irb: irb(main):001:0> Class.ancestors => [Class, Module, Object, Kernel, BasicObject] irb(main):002:0>

  • 0

Some interesting output from irb:

irb(main):001:0> Class.ancestors
=> [Class, Module, Object, Kernel, BasicObject]
irb(main):002:0> class Foo
irb(main):003:1> end
=> nil
irb(main):004:0> module Foo
irb(main):005:1> end
TypeError: Foo is not a module
        from (irb):4
        from D:/Ruby193/bin/irb:12:in '<main>'
irb(main):006:0> Foo.is_a? Module
=> true

According to definition of class, a class is a derived module which can be instantiated. But irb tells us, sometimes it is a module, and sometimes it is not…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:08:24+00:00Added an answer on June 3, 2026 at 1:08 am

    The problem here is that you have created a Class (Foo) and now are trying to redefine it as a Module. Regardless of the inheritance of classes and modules, you can’t change one into the other, or “cast” between them

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm getting some interesting behaviour from some filters stacked within a for loop.
I'm writing a stream transformer from some Input data type to an Output data
I have some interesting problem for an hour.. In my flex project, all width
Someone know some interesting and complete tutorial about how to create a Parent-Child dimension
I found some interesting post about memory usage and CPU usage here on Stack
I have found some interesting behavior and do not know why or how to
I find bloomberg providing information about some interesting quotes for example: http://www.bloomberg.com/quote/JPMVXYG7:IND/chart/ The question
While inspecting delegates in C# and .NET in general, I noticed some interesting facts:
The HTML5 spec defines some very interesting validation components, including pattern (for validating against
I was wondering if people could post some examples of interesting websites and web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.