class Cloverly::Estimate

Public Class Methods

carbon(args) click to toggle source
# File lib/cloverly/estimate.rb, line 28
def carbon(args)
  Cloverly.default.estimate_offset("carbon", args)
end
list(cloverly_instance = nil) click to toggle source
# File lib/cloverly/estimate.rb, line 19
def list(cloverly_instance = nil)
  c = cloverly_instance || Cloverly.default
  Cloverly::Estimate.parse(c, c.get("/2019-03-beta/estimates"))
end
retrieve(cloverly_instance = nil, slug) click to toggle source
# File lib/cloverly/estimate.rb, line 14
def retrieve(cloverly_instance = nil, slug)
  c = cloverly_instance || Cloverly.default
  Cloverly::Estimate.parse(c, c.get("/2019-03-beta/estimates/#{slug}"))
end
shipping(args) click to toggle source
# File lib/cloverly/estimate.rb, line 24
def shipping(args)
  Cloverly.default.estimate_offset("shipping", args)
end
vehicle(args) click to toggle source
# File lib/cloverly/estimate.rb, line 32
def vehicle(args)
  Cloverly.default.estimate_offset("vehicle", args)
end

Public Instance Methods

cancel!() click to toggle source
# File lib/cloverly/estimate.rb, line 8
def cancel!
  self.attributes = @cloverly_instance.delete("/2019-03-beta/estimates/#{slug}")
end
purchase!() click to toggle source
# File lib/cloverly/estimate.rb, line 4
def purchase!
  Cloverly::Purchase.parse(@cloverly_instance, @cloverly_instance.post("/2019-03-beta/purchases", {estimate_slug: self.slug}))
end