Class: PublishEvent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePublishEvent

Returns a new instance of PublishEvent.



6
7
8
9
# File 'lib/json/publish_event.rb', line 6

def initialize
  @published_at = 0
  @hashed = false
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#exposuresObject

Returns the value of attribute exposures.



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

def exposures
  @exposures
end

#goalsObject

Returns the value of attribute goals.



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

def goals
  @goals
end

#hashedObject

Returns the value of attribute hashed.



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

def hashed
  @hashed
end

#published_atObject

Returns the value of attribute published_at.



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

def published_at
  @published_at
end

#unitsObject

Returns the value of attribute units.



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

def units
  @units
end

Instance Method Details

#==(o) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/json/publish_event.rb', line 11

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

  that = o
  @hashed == that.hashed && @units == that.units &&
    @published_at == that.published_at && @exposures == that.exposures &&
    @goals == that.goals && @attributes == that.attributes
end

#hash_codeObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/json/publish_event.rb', line 21

def hash_code
  {
    hashed: @hashed,
    units: @units,
    published_at: @published_at,
    exposures: @exposures,
    goals: @goals,
    attributes: @attributes
  }
end

#to_sObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/json/publish_event.rb', line 32

def to_s
  "PublishEvent{" +
    "hashedUnits=#{@hashed}" +
    ", units=#{@units.inspect}" +
    ", publishedAt=#{@published_at}" +
    ", exposures=#{@exposures.inspect}" +
    ", goals=#{@goals.inspect}" +
    ", attributes=#{@attributes!=nil ? @attributes.join : ""}" +
    "}"
end