Class: Google::Apis::AnalyticsV3::Experiment::Variation

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/analytics_v3/classes.rb,
generated/google/apis/analytics_v3/representations.rb,
generated/google/apis/analytics_v3/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Variation

Returns a new instance of Variation



1964
1965
1966
# File 'generated/google/apis/analytics_v3/classes.rb', line 1964

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#nameString

The name of the variation. This field is required when creating an experiment. This field may not be changed for an experiment whose status is ENDED. Corresponds to the JSON property name

Returns:

  • (String)


1936
1937
1938
# File 'generated/google/apis/analytics_v3/classes.rb', line 1936

def name
  @name
end

#statusString

Status of the variation. Possible values: "ACTIVE", "INACTIVE". INACTIVE variations are not served. This field may not be changed for an experiment whose status is ENDED. Corresponds to the JSON property status

Returns:

  • (String)


1943
1944
1945
# File 'generated/google/apis/analytics_v3/classes.rb', line 1943

def status
  @status
end

#urlString

The URL of the variation. This field may not be changed for an experiment whose status is RUNNING or ENDED. Corresponds to the JSON property url

Returns:

  • (String)


1949
1950
1951
# File 'generated/google/apis/analytics_v3/classes.rb', line 1949

def url
  @url
end

#weightFloat

Weight that this variation should receive. Only present if the experiment is running. This field is read-only. Corresponds to the JSON property weight

Returns:

  • (Float)


1955
1956
1957
# File 'generated/google/apis/analytics_v3/classes.rb', line 1955

def weight
  @weight
end

#wonBoolean Also known as: won?

True if the experiment has ended and this variation performed (statistically) significantly better than the original. This field is read-only. Corresponds to the JSON property won

Returns:

  • (Boolean)


1961
1962
1963
# File 'generated/google/apis/analytics_v3/classes.rb', line 1961

def won
  @won
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1969
1970
1971
1972
1973
1974
1975
# File 'generated/google/apis/analytics_v3/classes.rb', line 1969

def update!(**args)
  @name = args[:name] if args.key?(:name)
  @status = args[:status] if args.key?(:status)
  @url = args[:url] if args.key?(:url)
  @weight = args[:weight] if args.key?(:weight)
  @won = args[:won] if args.key?(:won)
end