Ruby interface working against floor planners API.
Add this line to your application's Gemfile:
gem 'floorplanner'
And then execute:
$ bundle
Or install it yourself as:
$ gem install floorplanner
# Create a client for authenticated requests
client = Floorplanner::Client.new(api_key: 'yourkey', password: 'yourpwd', subdomain: 'skalar')
# Create a resource for Project API helper methods
resource = Floorplanner::Resources::ProjectsResource.new(client)
# Set up a project
new_project = Floorplanner::Models::Project.new(
name: "My test project",
description: "For demonstration purposes only",
public: true
)
# Create the project in Floorplanner, returning a new Floorplanner::Models::Project
# instance with an id assigned by Floorplanner
created = resource.create(new_project)
# Render a 2D version of the project
resource.render_2d(created.id, callback: 'http://my.server.com/callback-handler', width: 2000, height: 1500, fmt: ['jpg', 'pdf'])
# Check out lib/floorplanner/resources/projects_resource.rb for more helper methods.
# There is also Floorplanner::Resources::UsersResource with a helper method for
# creating authentication tokens for use in the embedded JavaScript/Flash editor.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request