Class: Psapi::Channel
- Inherits:
-
API_Object
- Object
- API_Object
- Psapi::Channel
- Defined in:
- lib/psapi/channel.rb
Defined Under Namespace
Classes: Connection, Info, Output, Status, Track
Instance Attribute Summary collapse
-
#channel_id ⇒ Object
Returns the value of attribute channel_id.
-
#info ⇒ Object
Returns the value of attribute info.
-
#status ⇒ Object
Returns the value of attribute status.
-
#track ⇒ Object
Returns the value of attribute track.
Class Method Summary collapse
Instance Method Summary collapse
- #broadcast ⇒ Object
- #bump ⇒ Object
- #connections ⇒ Object
-
#initialize(hash = {}) ⇒ Channel
constructor
A new instance of Channel.
- #outputs ⇒ Object
- #relay_tree ⇒ Object
-
#restart_announce(yellow_page) ⇒ Object
このチャンネルの yellow_page へのアナウンス接続をはりなおす.
- #stop ⇒ Object
-
#stop_announce(yellow_page) ⇒ Object
このチャンネルの yellow_page へのアナウンス接続を切断する.
- #yellow_pages ⇒ Object
Methods inherited from API_Object
accessors_for, define_all_with, inherited, #mass_assign
Methods included from Internal
Methods included from PeercastStation
Constructor Details
#initialize(hash = {}) ⇒ Channel
Returns a new instance of Channel.
12 13 14 15 16 17 18 19 |
# File 'lib/psapi/channel.rb', line 12 def initialize(hash = {}) super @status = Status.new(hash['status'] || {}) @info = Info.new(hash['info'] || {}) @track = Track.new(hash['track']) @yellow_pages = (hash['yellowPages'] || []) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Psapi::PeercastStation
Instance Attribute Details
#channel_id ⇒ Object
Returns the value of attribute channel_id.
8 9 10 |
# File 'lib/psapi/channel.rb', line 8 def channel_id @channel_id end |
#info ⇒ Object
Returns the value of attribute info.
9 10 11 |
# File 'lib/psapi/channel.rb', line 9 def info @info end |
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/psapi/channel.rb', line 9 def status @status end |
#track ⇒ Object
Returns the value of attribute track.
10 11 12 |
# File 'lib/psapi/channel.rb', line 10 def track @track end |
Class Method Details
Instance Method Details
#broadcast ⇒ Object
47 48 |
# File 'lib/psapi/channel.rb', line 47 def broadcast end |
#bump ⇒ Object
50 51 |
# File 'lib/psapi/channel.rb', line 50 def bump end |
#connections ⇒ Object
44 45 |
# File 'lib/psapi/channel.rb', line 44 def connections end |
#outputs ⇒ Object
53 54 |
# File 'lib/psapi/channel.rb', line 53 def outputs end |
#relay_tree ⇒ Object
56 57 58 |
# File 'lib/psapi/channel.rb', line 56 def relay_tree # tree of sessions end |
#restart_announce(yellow_page) ⇒ Object
このチャンネルの yellow_page へのアナウンス接続をはりなおす
65 66 |
# File 'lib/psapi/channel.rb', line 65 def restart_announce(yellow_page) end |
#stop ⇒ Object
38 39 |
# File 'lib/psapi/channel.rb', line 38 def stop end |
#stop_announce(yellow_page) ⇒ Object
このチャンネルの yellow_page へのアナウンス接続を切断する
61 62 |
# File 'lib/psapi/channel.rb', line 61 def stop_announce(yellow_page) end |
#yellow_pages ⇒ Object
21 22 23 24 25 26 |
# File 'lib/psapi/channel.rb', line 21 def yellow_pages yps = YellowPage.all @yellow_pages.map { |yellowPageId:| yps.find { |y| y.yellow_page_id == yellowPageId } or fail "yellow page id #{yellowPageId} not found" } end |