Class: Alpaca::News::Api::Models::Event
- Inherits:
-
Object
- Object
- Alpaca::News::Api::Models::Event
- Defined in:
- lib/alpaca/news/api/models/event.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Created timestamp.
-
#object ⇒ Alpaca::News::Api::Models::News
News object.
-
#objects ⇒ Array<Alpaca::News::Api::Models::News>
News objects.
-
#type ⇒ String, ...
Event type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Event
constructor
A new instance of Event.
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_at ⇒ Time
Created timestamp
30 31 32 |
# File 'lib/alpaca/news/api/models/event.rb', line 30 def created_at @created_at end |
#object ⇒ Alpaca::News::Api::Models::News
News object
12 13 14 |
# File 'lib/alpaca/news/api/models/event.rb', line 12 def object @object end |
#objects ⇒ Array<Alpaca::News::Api::Models::News>
News objects
18 19 20 |
# File 'lib/alpaca/news/api/models/event.rb', line 18 def objects @objects end |
#type ⇒ String, ...
Event type
24 25 26 |
# File 'lib/alpaca/news/api/models/event.rb', line 24 def type @type end |