lib/split/configuration.rb in split-0.6.0 vs lib/split/configuration.rb in split-0.6.1

- old
+ new

@@ -7,14 +7,15 @@ attr_accessor :db_failover attr_accessor :db_failover_on_db_error attr_accessor :db_failover_allow_parameter_override attr_accessor :allow_multiple_experiments attr_accessor :enabled - attr_accessor :experiments attr_accessor :persistence attr_accessor :algorithm + attr_reader :experiments + def bots @bots ||= { # Indexers "AdsBot-Google" => 'Google Adwords', 'Baidu' => 'Chinese search engine', @@ -59,9 +60,14 @@ # ??? "DigitalPersona Fingerprint Software" => 'HP Fingerprint scanner', "ShowyouBot" => 'Showyou iOS app spider', 'ZyBorg' => 'Zyborg? Hmmm....', } + end + + def experiments= experiments + raise InvalidExperimentsFormatError.new('Experiments must be a Hash') unless experiments.respond_to?(:keys) + @experiments = experiments end def disabled? !enabled end