Question: I need to define the constant in the module that use the method from the class that includes this module:

```
module B 
  def self.included(base)
    class << base
  CONST = self.find
    end
  end
end 

class A
  def self.find
    "AAA"
  end
  include B 
end

puts A::CONST

```

But the compiler gives the error on the 4th line.

Is there any other way to define the constant?

Answer: 
In your specific case.

```
module B 
  def self.included(base)
    base.const_set("CONST", base.find)
  end
end 

class A
  def self.find
    "AAA"
  end
  include B 
end

puts A::CONST

```

Despite it works, it's a little bit messy. Are you sure you can't follow a different way to achieve your goal?
```
module B 
  def self.included(base)
    class << base
      CONST = self.find
    end
  end
end 

class A
  class << self
    def self.find
       "AAA"
    end
  end
  include B 
end

```

then the compiler error is fixed, pls try.