简体   繁体   中英

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.

您可以这样调用方法:

A::AB::ABC.new.one

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM