Module: Rhosync

Defined in:
lib/rhosync/endpoints.rb,
lib/rhosync/client.rb,
lib/rhosync/version.rb,
lib/rhosync/resource.rb,
lib/rhosync/endpoints.rb,
lib/rhosync/configuration.rb

Overview

end

Defined Under Namespace

Modules: Resource Classes: Authenticate, BaseEndpoint, Client, Configuration, Create, Delete, EndpointHelpers, Query, Update

Constant Summary

VERSION =
"0.1.0"

Class Attribute Summary (collapse)

Class Method Summary (collapse)

Class Attribute Details

+ (Object) configuration

Returns the value of attribute configuration



12
13
14
# File 'lib/rhosync/configuration.rb', line 12

def configuration
  @configuration
end

Class Method Details

+ (Object) configure {|configuration| ... }

Configure RhoSync in an initializer: like config/initializers/rhosync.rb

Setup the RhoSync uri and api token. Use rhosync:get_token to get the token value.

config.uri   = "http://myrhosync.com"
config.token = "secrettoken"
config.authenticate = lambda { |credentials| 
  User.authenticate(credentials) 
}

Examples:

Rhosync.configure do |config|
  config.uri   = "http://myrhosync.com"
  config.token = "secrettoken"
end

Yields:



32
33
34
35
# File 'lib/rhosync/configuration.rb', line 32

def self.configure
  self.configuration = Configuration.new
  yield(configuration)
end