user871499
user871499

Reputation:

Ruby: How can i access method inside a module>module>class

Suppose there is a code like that :

module A
  module AB
    class ABC
      def one
        ....
      end

      def two
        ...
      end
.........
.........

Now how can i access method "one" , "two" etc from other ruby file?

Thanks in advance.

Upvotes: 1

Views: 3657

Answers (1)

Michael Kohl
Michael Kohl

Reputation: 66837

You can call the method like this:

A::AB::ABC.new.one

Upvotes: 11

Related Questions