https://github.com/skalar/floorplanner
Ruby interface for Floorplanner's REST API
https://github.com/skalar/floorplanner
Last synced: 3 months ago
JSON representation
Ruby interface for Floorplanner's REST API
- Host: GitHub
- URL: https://github.com/skalar/floorplanner
- Owner: Skalar
- License: mit
- Created: 2013-11-11T09:46:55.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-06-26T10:30:57.000Z (almost 6 years ago)
- Last Synced: 2024-04-14T07:55:21.182Z (about 1 year ago)
- Language: Ruby
- Size: 64.5 KB
- Stars: 1
- Watchers: 16
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Floorplanner
Ruby interface working against floor planners API.
[](https://travis-ci.org/Skalar/floorplanner)
## Installation
Add this line to your application's Gemfile:
gem 'floorplanner'
And then execute:
$ bundle
Or install it yourself as:
$ gem install floorplanner
## Usage
```Ruby
# 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.
```## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request