class GreatSchools::Score

GreatSchools Score

Attributes

rank[RW]
school_name[RW]
tests[RW]

Public Class Methods

for_school(state, id) click to toggle source

Returns test and rank data for a specific school.

Attributes

  • state - Two letter state abbreviation

  • id - Numeric id of a school. This GreatSchools ID is included in

    other listing requests like +GreatSchools::School#browse+
    and +GreatSchools::School#nearby+
# File lib/great_schools/score.rb, line 15
def for_school(state, id)
  response = GreatSchools::API.get("school/tests/#{state.upcase}/#{id}")

  new(response)
end

Public Instance Methods

rank=(params) click to toggle source

Set the GreatSchools::Rank.

Attributes

  • params - a Hash of GreatSchools::Rank attributes.

# File lib/great_schools/score.rb, line 27
def rank=(params)
  @rank = GreatSchools::Rank.new(params)
end
test=(params)
Alias for: tests=
tests=(params) click to toggle source

Set an array of GreatSchools::Test.

Attributes

  • params - a Hash or Array of GreatSchools::Test attributes.

# File lib/great_schools/score.rb, line 36
def tests=(params)
  @tests = []

  Array.wrap(params).each do |hash|
    @tests << GreatSchools::Test.new(hash)
  end

  @tests
end
Also aliased as: test=