Class: Alpaca::News::Api::Models::News
- Inherits:
-
Object
- Object
- Alpaca::News::Api::Models::News
- Defined in:
- lib/alpaca/news/api/models/news.rb
Instance Attribute Summary collapse
-
#author ⇒ String
News author.
-
#content ⇒ String
News content.
-
#created_at ⇒ String
News created_at timestamp (RFC 3339).
-
#headline ⇒ String
News headline.
-
#id ⇒ String
News object ID.
-
#images ⇒ Array
News images.
-
#source ⇒ String
News source.
-
#summary ⇒ String
News summary.
-
#symbols ⇒ Array
News symbols.
-
#updated_at ⇒ String
News updated_at timestamp (RFC 3339).
-
#url ⇒ String
News URL.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ News
constructor
Create new News object.
Constructor Details
#initialize(attributes = {}) ⇒ News
Create new News object
78 79 80 81 82 83 84 85 |
# File 'lib/alpaca/news/api/models/news.rb', line 78 def initialize(attributes = {}) @attributes = ActiveSupport::HashWithIndifferentAccess.new(attributes) @attributes.each do |key, value| method(:"#{key}=").call(value) end @created_at = Time.parse(@created_at) if @created_at.is_a?(String) @updated_at = Time.parse(@updated_at) if @updated_at.is_a?(String) end |
Instance Attribute Details
#author ⇒ String
News author
24 25 26 |
# File 'lib/alpaca/news/api/models/news.rb', line 24 def @author end |
#content ⇒ String
News content
54 55 56 |
# File 'lib/alpaca/news/api/models/news.rb', line 54 def content @content end |
#created_at ⇒ String
News created_at timestamp (RFC 3339)
30 31 32 |
# File 'lib/alpaca/news/api/models/news.rb', line 30 def created_at @created_at end |
#headline ⇒ String
News headline
18 19 20 |
# File 'lib/alpaca/news/api/models/news.rb', line 18 def headline @headline end |
#id ⇒ String
News object ID
12 13 14 |
# File 'lib/alpaca/news/api/models/news.rb', line 12 def id @id end |
#images ⇒ Array
News images
60 61 62 |
# File 'lib/alpaca/news/api/models/news.rb', line 60 def images @images end |
#source ⇒ String
News source
72 73 74 |
# File 'lib/alpaca/news/api/models/news.rb', line 72 def source @source end |
#summary ⇒ String
News summary
42 43 44 |
# File 'lib/alpaca/news/api/models/news.rb', line 42 def summary @summary end |
#symbols ⇒ Array
News symbols
66 67 68 |
# File 'lib/alpaca/news/api/models/news.rb', line 66 def symbols @symbols end |
#updated_at ⇒ String
News updated_at timestamp (RFC 3339)
36 37 38 |
# File 'lib/alpaca/news/api/models/news.rb', line 36 def updated_at @updated_at end |
#url ⇒ String
News URL
48 49 50 |
# File 'lib/alpaca/news/api/models/news.rb', line 48 def url @url end |