Class: Exposure

Inherits:
Object
  • Object
show all
Defined in:
lib/json/exposure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil, name = nil, unit = nil, variant = nil, exposed_at = nil, assigned = nil, eligible = nil, overridden = nil, full_on = nil, custom = nil, audience_mismatch = nil) ⇒ Exposure

Returns a new instance of Exposure.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/json/exposure.rb', line 7

def initialize(id = nil, name = nil, unit = nil, variant = nil,
               exposed_at = nil, assigned = nil, eligible = nil,
               overridden = nil, full_on = nil, custom = nil,
               audience_mismatch = nil)
  @id = id || 0
  @name = name
  @unit = unit
  @variant = variant
  @exposed_at = exposed_at
  @assigned = assigned
  @eligible = eligible
  @overridden = overridden
  @full_on = full_on
  @custom = custom
  @audience_mismatch = audience_mismatch
end

Instance Attribute Details

#assignedObject

Returns the value of attribute assigned.



4
5
6
# File 'lib/json/exposure.rb', line 4

def assigned
  @assigned
end

#audience_mismatchObject

Returns the value of attribute audience_mismatch.



4
5
6
# File 'lib/json/exposure.rb', line 4

def audience_mismatch
  @audience_mismatch
end

#customObject

Returns the value of attribute custom.



4
5
6
# File 'lib/json/exposure.rb', line 4

def custom
  @custom
end

#eligibleObject

Returns the value of attribute eligible.



4
5
6
# File 'lib/json/exposure.rb', line 4

def eligible
  @eligible
end

#exposed_atObject

Returns the value of attribute exposed_at.



4
5
6
# File 'lib/json/exposure.rb', line 4

def exposed_at
  @exposed_at
end

#full_onObject

Returns the value of attribute full_on.



4
5
6
# File 'lib/json/exposure.rb', line 4

def full_on
  @full_on
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/json/exposure.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/json/exposure.rb', line 4

def name
  @name
end

#overriddenObject

Returns the value of attribute overridden.



4
5
6
# File 'lib/json/exposure.rb', line 4

def overridden
  @overridden
end

#unitObject

Returns the value of attribute unit.



4
5
6
# File 'lib/json/exposure.rb', line 4

def unit
  @unit
end

#variantObject

Returns the value of attribute variant.



4
5
6
# File 'lib/json/exposure.rb', line 4

def variant
  @variant
end

Instance Method Details

#==(o) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/json/exposure.rb', line 24

def ==(o)
  return true if self.object_id == o.object_id
  return false if o.nil? || self.class != o.class

  @id == o.id && @name == o.name && @unit == o.unit &&
    @variant == o.variant && @exposed_at == o.exposed_at &&
    @assigned == o.assigned && @eligible == o.eligible &&
    @overridden == o.overridden && @full_on == o.full_on &&
    @custom == o.custom && @audience_mismatch == o.audience_mismatch
end

#hash_codeObject



35
36
37
38
39
40
41
42
43
# File 'lib/json/exposure.rb', line 35

def hash_code
  {
    id: @id, name: @name, unit: @unit,
    variant: @variant, exposed_at: @exposed_at,
    assigned: @assigned, eligible: @eligible,
    overridden: @overridden, full_on: @full_on,
    custom: @custom, audience_mismatch: @audience_mismatch
  }
end

#to_sObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/json/exposure.rb', line 45

def to_s
  "Exposure{" +
    "id=#{@id}" +
    "name='#{@name}'" +
    ", unit=#{@unit}" +
    ", variant=#{@variant}" +
    ", exposed_at=#{@exposed_at}" +
    ", assigned=#{@assigned}" +
    ", eligible=#{@eligible}" +
    ", overridden=#{@overridden}" +
    ", full_on=#{@full_on}" +
    ", custom=#{@custom}" +
    ", audience_mismatch=#{@audience_mismatch}" +
    "}"
end