Class: Shelbytv::ChannelProxy
- Inherits:
-
Object
- Object
- Shelbytv::ChannelProxy
- Defined in:
- lib/shelbytv/channel_proxy.rb
Instance Method Summary collapse
- #all(options = {}) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(shelbytv) ⇒ ChannelProxy
constructor
A new instance of ChannelProxy.
Constructor Details
#initialize(shelbytv) ⇒ ChannelProxy
Returns a new instance of ChannelProxy.
3 4 5 |
# File 'lib/shelbytv/channel_proxy.rb', line 3 def initialize(shelbytv) @shelbytv = shelbytv end |
Instance Method Details
#all(options = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/shelbytv/channel_proxy.rb', line 7 def all(={}) @shelbytv.get('channels.json', ).map do |item| Shelbytv::Channel.new(@shelbytv, item) end end |
#find(id) ⇒ Object
13 14 15 |
# File 'lib/shelbytv/channel_proxy.rb', line 13 def find(id) Shelbytv::Channel.new(@shelbytv, @shelbytv.get("channels/#{id}.json").first) end |