Module: Ratel::ActionViewExtension
- Defined in:
- lib/ratel/helper/action_view_extension.rb
Instance Method Summary collapse
Instance Method Details
#screen_changes(*args, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ratel/helper/action_view_extension.rb', line 4 def screen_changes *args, &block = args. key = :"#{Ratel.config.screen_key}#{[:at]}" ## TODO A/B テストの停止ロジック # redis などのkey-value 対応 or 設定ファイルでの制御? if [:with] == :reset or [key].nil? selected = :default = 0 num = Time.now.usec % 100 [:to].each do |k,v| += v if num < selected = k break end end .permanent.signed[key] = selected end block.call .signed[key] end |