Class: Squab::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/squab/events.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, url, uid, source, date = nil, id = nil) ⇒ Event

Returns a new instance of Event.



276
277
278
279
280
281
282
283
284
# File 'lib/squab/events.rb', line 276

def initialize(value, url, uid, source, date=nil, id=nil)
  @date = date
  @value = value
  @uid = uid
  @url = url
  @source = source
  @id = id
  @push = false
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



274
275
276
# File 'lib/squab/events.rb', line 274

def date
  @date
end

#idObject

Returns the value of attribute id.



274
275
276
# File 'lib/squab/events.rb', line 274

def id
  @id
end

#sourceObject

Returns the value of attribute source.



274
275
276
# File 'lib/squab/events.rb', line 274

def source
  @source
end

#uidObject

Returns the value of attribute uid.



274
275
276
# File 'lib/squab/events.rb', line 274

def uid
  @uid
end

#urlObject

Returns the value of attribute url.



274
275
276
# File 'lib/squab/events.rb', line 274

def url
  @url
end

#valueObject

Returns the value of attribute value.



274
275
276
# File 'lib/squab/events.rb', line 274

def value
  @value
end

Instance Method Details

#to_hObject



286
287
288
289
290
291
292
293
294
295
# File 'lib/squab/events.rb', line 286

def to_h
  {
    date: @date,
    uid: @uid,
    value: @value,
    url: @url,
    source: @source,
    id: @id,
  }
end

#to_json(*a) ⇒ Object



297
298
299
# File 'lib/squab/events.rb', line 297

def to_json(*a)
  self.to_h.to_json(*a)
end