module Spree
module ViewContext
def self.context=(context)
@context = context
end
def self.context
@context
end
def view_context
super.tap do |context|
Spree::ViewContext.context = context
end
end
end
end
在lib / spree / i18n / base.rb下可以帮助启发我上面的代码吗?我如何评估“def self.context =(context)”?什么是ViewContext模块的用途和用例?提前谢谢。