Scientist路径重构
Scientist 是一个用于精确重构关键路径的 Ruby 库。
示例代码:
require "scientist"class MyExperiment include ActiveModel::Model include Scientist::Experiment attr_accessor :name def enabled? # see "Ramping up experiments" below super end def publish(result) # see "Publishing results" below super end end # replace `Scientist::Default` as the default implementation module Scientist::Experiment def self.new(name) MyExperiment.new(name: name) end end
评论