Skip to content

Instantly share code, notes, and snippets.

@kenton
Created April 18, 2012 16:40
Show Gist options
  • Save kenton/2414892 to your computer and use it in GitHub Desktop.
Save kenton/2414892 to your computer and use it in GitHub Desktop.
>> pickup_coords = "37.7296575656584,-122.45277792457"
>> dropoff_coords = "37.7835680142054,-122.469833645424"
=> "37.7835680142054,-122.469833645424"
>> quote = Ondemand::Pricing::Ride::QuoteRide.new_from_rate_card(:dropoff_latlng => dropoff_coords, :pickup_latlng => pickup_coords)
#<Ondemand::Pricing::Formula:0x10a3088c8
@kind=:quote,
@market_rate=#<BigDecimal:10a2fd7e8,'0.2E2',9(27)>,
@minimum_price=#<BigDecimal:10a2fd928,'0.15E2',9(27)>,
@pricing_tiers=nil,
@ride=
#<Ondemand::Pricing::Ride::QuoteRide:0x10a324190
@dropoff=
#<Ondemand::Pricing::GeographicShapes::Location:0x10a3241e0
@geographic_shape=
#<GeographicShape id: 624, shape: #<GeoRuby::SimpleFeatures::Polygon:0x10a2f0480 @with_m=false, @srid=4326, @with_z=false, @rings=[#<GeoRuby::SimpleFeatures::LinearRing:0x10a2f0340 @with_m=false, @points=[#<GeoRuby::SimpleFeatures::Point:0x10a2f0228 @y=37.781321745516, @m=0.0, @z=0.0, @x=-122.472676265566, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2f0138 @y=37.7858142828949, @m=0.0, @z=0.0, @x=-122.472676265566, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2efff8 @y=37.7858142828949, @m=0.0, @z=0.0, @x=-122.466991025282, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2efeb8 @y=37.781321745516, @m=0.0, @z=0.0, @x=-122.466991025282, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2efd78 @y=37.781321745516, @m=0.0, @z=0.0, @x=-122.472676265566, @with_m=false, @srid=4326, @with_z=false>], @srid=4326, @with_z=false>]>, is_rectangle: true, code: "city/12778360575302", created_at: "2012-04-09 15:12:19", updated_at: "2012-04-16 18:21:25", center: #<GeoRuby::SimpleFeatures::Point:0x10a2ece48 @y=37.7835680142054, @m=0.0, @z=0.0, @x=-122.469833645424, @with_m=false, @srid=4326, @with_z=false>, ondemand_market_id: 1, rate_cardable: false, geographic_shape_layer_id: 4, name: nil>,
@latlng=
#<Geokit::LatLng:0x10a32fb58
@lat=37.7835680142054,
@lng=-122.469833645424>>,
@market=
#<OndemandMarket id: 1, name: "San Francisco", place_id: 3945, rate: #<BigDecimal:10a2ea3a0,'0.2E2',9(27)>, minimum_price: #<BigDecimal:10a2ea300,'0.15E2',9(27)>, created_at: "2012-02-09 09:09:57", updated_at: "2012-02-09 09:09:57", ten_mile_multiplier: nil, twenty_mile_multiplier: nil, time_factor: nil, pricing_tiers: nil>,
@pickup=
#<Ondemand::Pricing::GeographicShapes::Location:0x10a324898
@geographic_shape=
#<GeographicShape id: 987, shape: #<GeoRuby::SimpleFeatures::Polygon:0x10a2e6390 @with_m=false, @srid=4326, @with_z=false, @rings=[#<GeoRuby::SimpleFeatures::LinearRing:0x10a2e6250 @with_m=false, @points=[#<GeoRuby::SimpleFeatures::Point:0x10a2e6138 @y=37.727411296969, @m=0.0, @z=0.0, @x=-122.455620544712, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2e6048 @y=37.7319038343479, @m=0.0, @z=0.0, @x=-122.455620544712, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2e5f08 @y=37.7319038343479, @m=0.0, @z=0.0, @x=-122.449935304428, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2e5dc8 @y=37.727411296969, @m=0.0, @z=0.0, @x=-122.449935304428, @with_m=false, @srid=4326, @with_z=false>, #<GeoRuby::SimpleFeatures::Point:0x10a2e5c88 @y=37.727411296969, @m=0.0, @z=0.0, @x=-122.455620544712, @with_m=false, @srid=4326, @with_z=false>], @srid=4326, @with_z=false>]>, is_rectangle: true, code: "city/12772970575472", created_at: "2012-04-09 15:12:20", updated_at: "2012-04-16 18:21:27", center: #<GeoRuby::SimpleFeatures::Point:0x10a2e2d58 @y=37.7296575656584, @m=0.0, @z=0.0, @x=-122.45277792457, @with_m=false, @srid=4326, @with_z=false>, ondemand_market_id: 1, rate_cardable: false, geographic_shape_layer_id: 4, name: nil>,
@latlng=
#<Geokit::LatLng:0x10a32fa68
@lat=37.7296575656584,
@lng=-122.45277792457>,
@market=
#<OndemandMarket id: 1, name: "San Francisco", place_id: 3945, rate: #<BigDecimal:10a2e0328,'0.2E2',9(27)>, minimum_price: #<BigDecimal:10a2e0288,'0.15E2',9(27)>, created_at: "2012-02-09 09:09:57", updated_at: "2012-02-09 09:09:57", ten_mile_multiplier: nil, twenty_mile_multiplier: nil, time_factor: nil, pricing_tiers: nil>>,
@route=
#<OndemandRoute id: 550687, distance: 8854, time: 1032, created_at: "2012-04-16 18:29:18", updated_at: "2012-04-16 18:29:18", flat_rate: nil, from_id: 987, to_id: 624>>,
@ten_mile_multiplier=nil,
@time_factor=nil,
@twenty_mile_multiplier=nil>
ArgumentError: Not priceable, params=.
from /Users/kentonnewby/dev/limos/lib/ondemand/pricing/formula.rb:112:in `initialize_from_ride'
from /Users/kentonnewby/dev/limos/lib/ondemand/pricing/formula.rb:69:in `initialize'
from /Users/kentonnewby/dev/limos/lib/ondemand/pricing/ride/abstract_ride.rb:71:in `new'
from /Users/kentonnewby/dev/limos/lib/ondemand/pricing/ride/abstract_ride.rb:71:in `initialize'
from /Users/kentonnewby/dev/limos/lib/ondemand/pricing/ride/quote_ride.rb:32:in `new'
from /Users/kentonnewby/dev/limos/lib/ondemand/pricing/ride/quote_ride.rb:32:in `new_from_rate_card'
from (irb):7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment