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
-
#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.
11 12 13 14 15 16 17 |
# File 'lib/psapi/channel.rb', line 11 def initialize(hash = {}) @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
#info ⇒ Object
Returns the value of attribute info.
8 9 10 |
# File 'lib/psapi/channel.rb', line 8 def info @info end |
#status ⇒ Object
Returns the value of attribute status.
8 9 10 |
# File 'lib/psapi/channel.rb', line 8 def status @status end |
#track ⇒ Object
Returns the value of attribute track.
9 10 11 |
# File 'lib/psapi/channel.rb', line 9 def track @track end |
Class Method Details
Instance Method Details
#broadcast ⇒ Object
45 46 |
# File 'lib/psapi/channel.rb', line 45 def broadcast end |
#bump ⇒ Object
48 49 |
# File 'lib/psapi/channel.rb', line 48 def bump end |
#connections ⇒ Object
42 43 |
# File 'lib/psapi/channel.rb', line 42 def connections end |
#outputs ⇒ Object
51 52 |
# File 'lib/psapi/channel.rb', line 51 def outputs end |
#relay_tree ⇒ Object
54 55 56 |
# File 'lib/psapi/channel.rb', line 54 def relay_tree # tree of sessions end |
#restart_announce(yellow_page) ⇒ Object
このチャンネルの yellow_page へのアナウンス接続をはりなおす
63 64 |
# File 'lib/psapi/channel.rb', line 63 def restart_announce(yellow_page) end |
#stop ⇒ Object
36 37 |
# File 'lib/psapi/channel.rb', line 36 def stop end |
#stop_announce(yellow_page) ⇒ Object
このチャンネルの yellow_page へのアナウンス接続を切断する
59 60 |
# File 'lib/psapi/channel.rb', line 59 def stop_announce(yellow_page) end |
#yellow_pages ⇒ Object
19 20 21 22 23 24 |
# File 'lib/psapi/channel.rb', line 19 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 |