Class: Alpaca::News::Api::Models::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/alpaca/news/api/models/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Event

Returns a new instance of Event.



32
33
34
35
36
37
38
# File 'lib/alpaca/news/api/models/event.rb', line 32

def initialize(attributes = {})
  @attributes = ActiveSupport::HashWithIndifferentAccess.new(attributes)
  self.object = @attributes[:object]
  self.objects = @attributes[:objects]
  self.type = @attributes[:type]
  self.created_at = Time.now.utc
end

Instance Attribute Details

#created_atTime

Created timestamp

Returns:

  • (Time)


30
31
32
# File 'lib/alpaca/news/api/models/event.rb', line 30

def created_at
  @created_at
end

#objectAlpaca::News::Api::Models::News

News object



12
13
14
# File 'lib/alpaca/news/api/models/event.rb', line 12

def object
  @object
end

#objectsArray<Alpaca::News::Api::Models::News>

News objects



18
19
20
# File 'lib/alpaca/news/api/models/event.rb', line 18

def objects
  @objects
end

#typeString, ...

Event type

Returns:

  • (String, Symbol, nil)


24
25
26
# File 'lib/alpaca/news/api/models/event.rb', line 24

def type
  @type
end