Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Becca and Tammy Shipping API #20

Open
wants to merge 24 commits into
base: RTTH/master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added method to the pachage controller and 2 methods for the model
  • Loading branch information
TammyHer committed Jan 21, 2016
commit b4d0d0f0d51f69d256ece8a8a935f7294f63717e
22 changes: 22 additions & 0 deletions app/controllers/packages_controller.rb
Original file line number Diff line number Diff line change
@@ -2,5 +2,27 @@

class PackagesController < ApplicationController

def receive_info
@hash =
end
def ups_price_estimate


end

def usps_price_estimate

end

def ups_delivery_time

end

def usps_delivery_time

end




end
21 changes: 21 additions & 0 deletions app/models/package.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class Package < ActiveRecord::Base

def get_package
package = [
ActiveShipping::Package.new(100,
[100,100],
valule: 10000)
]

return package
end

def get_origin
origin = ActiveShipping::UPS.new(country: 'US',
state: 'WA',
city: 'Seattle',
zip: 98122)
return origin
end

end
8 changes: 8 additions & 0 deletions db/migrate/20160121223301_create_packages.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class CreatePackages < ActiveRecord::Migration
def change
create_table :packages do |t|

t.timestamps null: false
end
end
end
16 changes: 16 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 0) do

end
1 change: 1 addition & 0 deletions spec/models/packages.rb → spec/models/package_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'rails_helper'

RSpec.describe Package, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end