Class: Psapi::YellowPage

Inherits:
API_Object show all
Defined in:
lib/psapi/yellow_page.rb

Defined Under Namespace

Classes: Announcing, Protocol

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from API_Object

accessors_for, define_all_with, inherited, #mass_assign

Methods included from Internal

camel_to_snake

Methods included from PeercastStation

initialize, #method_missing

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

#announcingsObject (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

#protocolObject



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

#removeObject



34
35
# File 'lib/psapi/yellow_page.rb', line 34

def remove
end

#saveObject



31
32
# File 'lib/psapi/yellow_page.rb', line 31

def save
end