class Foo1
def self.foo1action(cake)
# returns user object
end
end
class Foo2
def foo2action
user = # here i want call foo1action
end
end
如何在foo2action中调用foo1action? 这基于rails框架。我知道继承是一种方法......我想知道其他方式这样做..
答案 0 :(得分:2)
class Foo1
def self.foo_1_action(cake)
end
end
class Foo2
def foo_2_action
user = ::Foo1.foo_1_action(some_cake)
end
end