Class: Shelbytv::ChannelProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/shelbytv/channel_proxy.rb

Instance Method Summary collapse

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(options={})
  @shelbytv.get('channels.json', options).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