开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜