Class: Squab::Event
- Inherits:
-
Object
- Object
- Squab::Event
- Defined in:
- lib/squab/events.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#source ⇒ Object
Returns the value of attribute source.
-
#uid ⇒ Object
Returns the value of attribute uid.
-
#url ⇒ Object
Returns the value of attribute url.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, url, uid, source, date = nil, id = nil) ⇒ Event
constructor
A new instance of Event.
- #to_h ⇒ Object
- #to_json(*a) ⇒ Object
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
#date ⇒ Object
Returns the value of attribute date.
274 275 276 |
# File 'lib/squab/events.rb', line 274 def date @date end |
#id ⇒ Object
Returns the value of attribute id.
274 275 276 |
# File 'lib/squab/events.rb', line 274 def id @id end |
#source ⇒ Object
Returns the value of attribute source.
274 275 276 |
# File 'lib/squab/events.rb', line 274 def source @source end |
#uid ⇒ Object
Returns the value of attribute uid.
274 275 276 |
# File 'lib/squab/events.rb', line 274 def uid @uid end |
#url ⇒ Object
Returns the value of attribute url.
274 275 276 |
# File 'lib/squab/events.rb', line 274 def url @url end |
#value ⇒ Object
Returns the value of attribute value.
274 275 276 |
# File 'lib/squab/events.rb', line 274 def value @value end |
Instance Method Details
#to_h ⇒ Object
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 |