Class: Psapi::YellowPage
- Inherits:
-
API_Object
- Object
- API_Object
- Psapi::YellowPage
- Defined in:
- lib/psapi/yellow_page.rb
Defined Under Namespace
Classes: Announcing, Protocol
Instance Attribute Summary collapse
-
#announcings ⇒ Object
readonly
Returns the value of attribute announcings.
Instance Method Summary collapse
-
#initialize(hash) ⇒ YellowPage
constructor
A new instance of YellowPage.
- #protocol ⇒ Object
- #remove ⇒ Object
- #save ⇒ 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) ⇒ YellowPage
Returns a new instance of YellowPage.
8 9 10 11 12 13 14 |
# File 'lib/psapi/yellow_page.rb', line 8 def initialize(hash) super @announcings = hash['channels'].map { |h| Announcing.new(h) } @protocol = hash['protocol'] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Psapi::PeercastStation
Instance Attribute Details
#announcings ⇒ Object (readonly)
Returns the value of attribute announcings.
6 7 8 |
# File 'lib/psapi/yellow_page.rb', line 6 def announcings @announcings end |
Instance Method Details
#protocol ⇒ Object
16 17 18 19 |
# File 'lib/psapi/yellow_page.rb', line 16 def protocol Protocol.all.find { |prot| prot.protocol == @protocol } or fail "yellow page protocol #{@protocol} not found" end |
#remove ⇒ Object
34 35 |
# File 'lib/psapi/yellow_page.rb', line 34 def remove end |
#save ⇒ Object
31 32 |
# File 'lib/psapi/yellow_page.rb', line 31 def save end |