Class: Twitch::Stream
- Inherits:
-
Object
- Object
- Twitch::Stream
- Defined in:
- lib/twitch/stream.rb
Constant Summary collapse
- DATE_ATTRIBUTES =
[:started_at]
Instance Attribute Summary collapse
-
#community_ids ⇒ Object
readonly
Returns the value of attribute community_ids.
-
#game_id ⇒ Object
readonly
Returns the value of attribute game_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#thumbnail_url ⇒ Object
readonly
Returns the value of attribute thumbnail_url.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
-
#viewer_count ⇒ Object
readonly
Returns the value of attribute viewer_count.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Stream
constructor
A new instance of Stream.
Constructor Details
#initialize(attributes = {}) ⇒ Stream
Returns a new instance of Stream.
8 9 10 11 12 13 14 15 16 |
# File 'lib/twitch/stream.rb', line 8 def initialize(attributes = {}) attributes.each do |k, v| if DATE_ATTRIBUTES.include?(k.to_sym) instance_variable_set("@#{k}", Time.parse(v)) else instance_variable_set("@#{k}", v) end end end |
Instance Attribute Details
#community_ids ⇒ Object (readonly)
Returns the value of attribute community_ids.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def community_ids @community_ids end |
#game_id ⇒ Object (readonly)
Returns the value of attribute game_id.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def game_id @game_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def id @id end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def language @language end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def started_at @started_at end |
#thumbnail_url ⇒ Object (readonly)
Returns the value of attribute thumbnail_url.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def thumbnail_url @thumbnail_url end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def type @type end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def user_id @user_id end |
#viewer_count ⇒ Object (readonly)
Returns the value of attribute viewer_count.
5 6 7 |
# File 'lib/twitch/stream.rb', line 5 def viewer_count @viewer_count end |