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 7929167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:59:11+00:00 2026-06-03T19:59:11+00:00

Some times I see code like this: module Elite module App def app ‘run

  • 0

Some times I see code like this:

module Elite

    module App
        def app
            'run app'
        end
    end

    module Base
        def base
            'base module'
        end
    end

    class Application
        include Elite::Base #Include variant A
        include ::Elite::App #Include variant B

        def initialize(str=nil) 
            puts "Initialized with #{str}"
            puts "Is respond to base?: #{base if self.respond_to?(:base)}"
            puts "Is respond to app?: #{app if self.respond_to?(:app)}"

        end
    end

    class Store < ::Elite::Application

        def initialize(str=nil)
            super #Goes to Application init
        end
    end
end

elite = Elite::Store.new(:hello)

But I don’t understand what’s different between class Store < ::Elite::Application and class Store < Elite::Application or include Elite::Base and include ::Elite::App
Is it only coding style, or ìs it something different?

What does :: do before Class/Module? :: clean namespace (module name) for class/module? Because class Store < Application works, but this doesn’t: class Store < ::Application. Please tell me what’s the difference… Thanks!

  • 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-03T19:59:12+00:00Added an answer on June 3, 2026 at 7:59 pm

    ‘::’ is the base(global) scope operator.

    So ‘::Application’ references the base Application where as ‘Application’ references Application in the current scope.

    For example

    class Application # Class 1
    end
    
    class Smile
      class Application # Class 2
      end
    
      ::Application # references class 1
      Application # references class 2 (The application in my current scope)
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code like: def example(parameter): global str str = str(parameter) print(str) example(1)
I have some threads fishing into a queue for jobs, something like this: class
Sometimes I see code like let (alt : recognizer -> recognizer -> recognizer) =
some times i see that functions are defined as below: read_dir(dir) char *dir; {
I see this all the time: object literals declared such that some keys are
Looking at some code I'm maintaining in System Verilog I see some signals that
I feel like this will end in a facepalm moment but I've been banging
Sometimes when I see my logging code I wonder if I am doing it
Sometime when looking through code, I see many methods specify an annotation: @SuppressWarnings(unchecked) What
I've spent some time casually mulling over ACLs in my head. I can see

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.