Class: GreatSchools::Score

Inherits:
Model
  • Object
show all
Defined in:
lib/great_schools/score.rb

Overview

GreatSchools Score

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from GreatSchools::Model

Instance Attribute Details

#rankObject

Returns the value of attribute rank.



4
5
6
# File 'lib/great_schools/score.rb', line 4

def rank
  @rank
end

#school_nameObject

Returns the value of attribute school_name.



4
5
6
# File 'lib/great_schools/score.rb', line 4

def school_name
  @school_name
end

#testsObject

Returns the value of attribute tests.



4
5
6
# File 'lib/great_schools/score.rb', line 4

def tests
  @tests
end

Class Method Details

.for_school(state, id) ⇒ Object

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+
    


15
16
17
18
19
# 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