Skip to content
This repository

Ruby wrapper for GroupDocs API

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 CHANGELOG.md
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 groupdocs.gemspec
README.md

GroupDocs Build Status

Ruby SDK for GroupDocs REST API.

Installation

Install as usually

gem install groupdocs

Installing from source

gem install bundler # unless it's already installed
git clone git@github.com:groupdocs/groupdocs-ruby.git
cd groupdocs-ruby/
git checkout master
bundle install --path vendor/bundle
bundle exec rake install

Usage

All "bang" methods (ending with exclamation sign) imply interaction with API server.

Other methods (with expect to some, see documentation) do not operate with API Server

Configuration

First of all you need to configure your access to API server.

require 'groupdocs'

GroupDocs.configure do |groupdocs|
  groupdocs.client_id = 'your_client_id'
  groupdocs.private_key = 'your_private_key'
  # optionally specify API server and version
  groupdocs.api_server = 'https://dev-api.groupdocs.com' # default is 'https://api.groupdocs.com'
  groupdocs.api_version = '3.0' # default is '2.0'
end

GroupDocs::Storage::Folder.create!('/folder')
#=> #<GroupDocs::Storage::Folder:0x0000000171f432 @id=1, @name="folder", @url="http://groupdocs.com">

You can also pass access credentials to particular requests

GroupDocs::Storage::Folder.create!('/folder', client_id: 'your_client_id', private_key: 'your_private_key')
#=> #<GroupDocs::Storage::Folder:0x0000000171f432 @id=1, @name="folder", @url="http://groupdocs.com">

Documentation

Reference to this page for docs and examples.

There is rather exhaustive documentation about internal SDK structure at wiki page.

There are also some examples in repository and on wiki

Entities

All entities can be initialized in several ways.

  • Object is created, attributes are set later.
folder = GroupDocs::Storage::Folder.new
folder.name = 'Folder'
folder.inspect
#=> #<GroupDocs::Storage::Folder:0x0000000171f432 @name="Folder">
  • Hash of attributes are passed to object constructor.
GroupDocs::Storage::Folder.new(name: 'Folder')
#=> #<GroupDocs::Storage::Folder:0x0000000171f432 @name="Folder">
  • Block is passed to object constructor.
GroupDocs::Storage::Folder.new do |folder|
  folder.name = 'Folder'
end
#=> #<GroupDocs::Storage::Folder:0x0000000171f432 @name="Folder">

Copyright

Copyright (c) 2012 Aspose Inc.

Something went wrong with that request. Please try again.