Class: Nhtsa::Complaints::ComplaintsByOdiNumber
- Inherits:
-
Object
- Object
- Nhtsa::Complaints::ComplaintsByOdiNumber
- Defined in:
- lib/nhtsa/complaints.rb
Instance Method Summary collapse
- #complaints_by_odi_number ⇒ Object
-
#initialize(odi_number) ⇒ ComplaintsByOdiNumber
constructor
A new instance of ComplaintsByOdiNumber.
- #url ⇒ Object
Constructor Details
#initialize(odi_number) ⇒ ComplaintsByOdiNumber
Returns a new instance of ComplaintsByOdiNumber.
65 66 67 |
# File 'lib/nhtsa/complaints.rb', line 65 def initialize(odi_number) @odi_number = odi_number end |
Instance Method Details
#complaints_by_odi_number ⇒ Object
73 74 75 |
# File 'lib/nhtsa/complaints.rb', line 73 def complaints_by_odi_number JSON.parse(open(url).read)["Results"] end |
#url ⇒ Object
69 70 71 |
# File 'lib/nhtsa/complaints.rb', line 69 def url BASE_URI + END_POINT + "/odinumber/#{@odi_number}" + DEFAULT_PARAMS end |