Last active
October 23, 2015 20:41
-
-
Save ajsharp/f00a16a624c07eaa1eb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Location < ActiveRecord::Base | |
| # fields: name, street1, city, state, zip | |
| end | |
| class DateStep < ActiveRecord::Base | |
| # fields: start_time | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The top-level keys are the names of remote API's from which we'd like to pull data. | |
| # The second-level objects are local model names. | |
| # The third-level objects are fields of those local models. The values they point to are "json object paths". | |
| # | |
| # EXAMPLE | |
| # ======= | |
| # Assume stubhub returns an event payload that looks like this: | |
| # { | |
| # "event": { | |
| # "venue": { | |
| # "title" : "Staples Center", | |
| # "city" : "Los Angeles", | |
| # "state" : "CA" | |
| # } | |
| # } | |
| # } | |
| # | |
| # What we want to do, is to be to easily, with static configuration, map the remote | |
| # data into local objects, using something like this: | |
| # Location.new(Integrations.stubhub_event("STUBHUB_EVENT_ID").location) | |
| # | |
| stubhub: | |
| location: | |
| name: event.venue.title | |
| seatgeek: | |
| location: | |
| name: venue.title | |
| fandango: | |
| location: | |
| name: theater.location.name | |
| street1: theater.location.street1 | |
| zip: theater.location.postal_code | |
| date_step: | |
| start_time: showing.start_time | |
| estimated_ticket_price: showing.tickets.price | |
| tickets_available: showing.tickets.num_available |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment