Project

hubs3d

0.0
No commit activity in last 3 years
No release in over 3 years
Upload 3D Models and create carts on 3D Hubs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

>= 0
 Project Readme

Ruby gem to access 3D Hubs' API

Configuration

Hubs3D.configure do |c|
  c.oauth_key = "YOUR_API_KEY_HERE"
  c.oauth_secret = "YOUR_API_SECRET_HERE"
end

Usage

Upload a model and get its id back

model = Hubs3D::Model.new(path: "/path/to/example.stl",
                          name: "example.stl")
model.id # => 42

Create a cart and get its url to redirect to

cart = Hubs3D::Cart.new
cart << model
cart.url # => "https://www.3dhubs.com/…"

A cart can also take a third_party_id and a designer_tip

cart = Hubs3D::Cart.new(
  designer_tip: Hubs3D::Tip.new(amount_cents: 42_00,
                                currency: "EUR",
                                uuid: "5-42-42",
                                mandatory: true),
  third_party_id: 42
)

Install

Add the following lines to your Gemfile if you are using the bundler gem:

# Client for 3D Hub's API
gem "hubs3d"

Development

To launch specs:

$ rake

License

Created by Sunny Ripert for Cults., licensed under the MIT License.

See also