module ESPN::Client::Notes

Public: The mapping to the RESEARCH NOTES API of the ESPN developer API.

Examples

class Client
  include ESPN::Client::Notes
end

Public Instance Methods

note(id, opts={}) click to toggle source

Public: Get a specific note from the ESPN developer API.

id - The id of a specific note. opts - Hash options used to refine the selection. You can find a full

list of options on the ESPN developer API website (default: {}).

Returns a Hashie::Mash.

# File lib/espn/client/notes.rb, line 20
def note(id, opts={})
  get("sports/news/notes/#{id}", opts).notes.first
end
notes(*args) click to toggle source

Public: Get Exclusive factoids produced by ESPN’s Stats and Information Group from the ESPN API.

sport - A Symbol or String of the sport (optional). league - A Symbol or String of the league. If a league is passed, but

not a sport, an attempt will be made to map the league to a
sport (required).

opts - Hash options used to refine the selection. If sport and/or

league are passed in, they will override the mapped values
You can find a full list of options on the ESPN developer API
website (default: {}).

Returns an Array of Hashie::Mash.

# File lib/espn/client/notes.rb, line 37
def notes(*args)
  arguments = ESPN::Arguments.new(args)
  pattern = "sports/:sport/:league/news/notes"
  get(pattern, arguments.options).notes
end