开发者

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

开发者 https://www.devze.com 2023-03-25 09:16 出处:网络
Su开发者_JAVA技巧ppose there is a code like that : module A module AB class ABC def one .... end def two

Su开发者_JAVA技巧ppose 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.


You can call the method like this:

A::AB::ABC.new.one
0

精彩评论

暂无评论...
验证码 换一张
取 消