Class: Io::Flow::V0::Models::ExperimentStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Represents a single instance of an experiment (e.g. page request) resulting in a decision as to the status of a given experiment

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ExperimentStatus

Returns a new instance of ExperimentStatus.



15428
15429
15430
15431
15432
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15428

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:enabled], 'ExperimentStatus')
  @enabled = HttpClient::Preconditions.assert_boolean('enabled', opts.delete(:enabled))
end

Instance Attribute Details

#enabledObject (readonly)

Returns the value of attribute enabled.



15426
15427
15428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15426

def enabled
  @enabled
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



15438
15439
15440
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15438

def copy(incoming={})
  ExperimentStatus.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



15442
15443
15444
15445
15446
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15442

def to_hash
  {
    :enabled => enabled
  }
end

#to_jsonObject



15434
15435
15436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15434

def to_json
  JSON.dump(to_hash)
end