Module: ESPN::Client::Video

Included in:
ESPN::Client
Defined in:
lib/espn/client/video.rb

Instance Method Summary collapse

Instance Method Details

#video(opts = {}) ⇒ Object

Public: Get video clip and channel information from ESPN.

opts - Hash options used to refine the selection (default: {}).

- :category_id  - The id of the category (default: nil).
- :clip_id      - The id of the clip (default: nil).

Returns an Array of Hashie::Mash.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/espn/client/video.rb', line 12

def video(opts={})
  url = 'video/channels'

  unless opts[:category_id].to_s.empty?
    url += "/#{opts[:category_id]}"
  end

  url += '/clips'

  unless opts[:clip_id].to_s.empty?
    url += "/#{opts[:clip_id]}"
  end

  get(url, opts)
end