One Eye Eater

Ruby wrapper for One Eye.

Object-oriented wrappers

For traditional, RESTful endpoints, use Rails-style CRUD actions:

# find
@school = OneEye::School.find(334517)
expect(@school.name).to eq("October's Very Own School")

# where
@schools = OneEye::School.where(:district_id => 21417)
expect(@schools.length).to eq(1)

# create
@user = OneEye::User.create(:first_name => "Drake")
expect(@user.first_name).to eq("Drake")

# update
@district = OneEye::District.find(1)
@district.update(:name => "Young Money Cash Money Billionaires District")
expect(@district.name).to eq("Young Money Cash Money Billionaires District")

# destroy
@district = OneEye::District.find(1)
@district.destroy

Dynamic Dispatch

For endpoints with custom aggregation options, One Eye Eater classes will dynamically dispatch methods called on them as custom finders:

# GET /insights/snapshot_performance/schools
OneEye::Insights::SnapshotPerformance.schools(:district_id => 1)

# GET /insights/snapshot_usage/districts
OneEye::Insights::SnapshotUsage.districts(:assessment_area => "CCSS.ELA", :district_id => 1)

Copyright © 2014 Edmodo. See LICENSE.txt for further details.