class NHLStats::Conference
Attributes
id[R]
name[R]
Public Class Methods
find(id)
click to toggle source
# File lib/nhl_stats/conference.rb, line 10 def self.find(id) response = Faraday.get("#{API_ROOT}/conferences/#{id}") attributes = JSON.parse(response.body).dig("conferences", 0) new(attributes) end
list()
click to toggle source
# File lib/nhl_stats/conference.rb, line 16 def self.list response = Faraday.get("#{API_ROOT}/conferences") JSON.parse(response.body). dig("conferences"). map { |c| NHLStats::Conference.new(c) } end
new(conference_data)
click to toggle source
# File lib/nhl_stats/conference.rb, line 5 def initialize(conference_data) @id = conference_data["id"] @name = conference_data["name"] end