Class: Nicoalert::Live
- Inherits:
-
Object
- Object
- Nicoalert::Live
- Defined in:
- lib/nicoalert/live.rb
Instance Attribute Summary collapse
-
#community_id ⇒ Object
readonly
Returns the value of attribute community_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #community ⇒ Object
- #community_name ⇒ Object
- #community_thumbnail ⇒ Object
- #description ⇒ Object
-
#initialize(id, community_id) ⇒ Live
constructor
A new instance of Live.
- #provider_type ⇒ Object
- #title ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(id, community_id) ⇒ Live
Returns a new instance of Live.
10 11 12 13 |
# File 'lib/nicoalert/live.rb', line 10 def initialize(id, community_id) @id = id @community_id = community_id end |
Instance Attribute Details
#community_id ⇒ Object (readonly)
Returns the value of attribute community_id.
8 9 10 |
# File 'lib/nicoalert/live.rb', line 8 def community_id @community_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/nicoalert/live.rb', line 8 def id @id end |
Instance Method Details
#community ⇒ Object
39 40 41 |
# File 'lib/nicoalert/live.rb', line 39 def community @community ||= Community.new(community_id, community_name, community_thumbnail) end |
#community_name ⇒ Object
31 32 33 |
# File 'lib/nicoalert/live.rb', line 31 def community_name @name ||= info.css('communityinfo name').text end |
#community_thumbnail ⇒ Object
35 36 37 |
# File 'lib/nicoalert/live.rb', line 35 def community_thumbnail @thumbnail ||= URI.parse(info.css('communityinfo thumbnail').text) end |
#description ⇒ Object
19 20 21 |
# File 'lib/nicoalert/live.rb', line 19 def description @description ||= info.css('streaminfo description').text end |
#provider_type ⇒ Object
23 24 25 |
# File 'lib/nicoalert/live.rb', line 23 def provider_type @provider_type ||= info.css('streaminfo provider_type').text.to_sym end |
#title ⇒ Object
15 16 17 |
# File 'lib/nicoalert/live.rb', line 15 def title @title ||= info.css('streaminfo title').text end |
#uri ⇒ Object
27 28 29 |
# File 'lib/nicoalert/live.rb', line 27 def uri @uri ||= "#{LIVE_URI}#@id" end |