Module: Force

Defined in:
lib/force.rb,
lib/force/mash.rb,
lib/force/client.rb,
lib/force/config.rb,
lib/force/sobject.rb,
lib/force/version.rb,
lib/force/upload_io.rb,
lib/force/attachment.rb,
lib/force/collection.rb,
lib/force/middleware.rb,
lib/force/data/client.rb,
lib/force/concerns/api.rb,
lib/force/concerns/base.rb,
lib/force/concerns/verbs.rb,
lib/force/signed_request.rb,
lib/force/tooling/client.rb,
lib/force/abstract_client.rb,
lib/force/concerns/canvas.rb,
lib/force/middleware/gzip.rb,
lib/force/concerns/caching.rb,
lib/force/middleware/logger.rb,
lib/force/concerns/picklists.rb,
lib/force/concerns/streaming.rb,
lib/force/middleware/caching.rb,
lib/force/middleware/mashify.rb,
lib/force/concerns/connection.rb,
lib/force/middleware/multipart.rb,
lib/force/middleware/raise_error.rb,
lib/force/concerns/authentication.rb,
lib/force/middleware/instance_url.rb,
lib/force/middleware/authorization.rb,
lib/force/middleware/authentication.rb,
lib/force/middleware/authentication/token.rb,
lib/force/middleware/authentication/password.rb

Defined Under Namespace

Modules: Concerns, CoreExtensions, Data, Tooling Classes: AbstractClient, Attachment, Collection, Configuration, Mash, Middleware, SObject, SignedRequest

Constant Summary collapse

Error =
Class.new(StandardError)
AuthenticationError =
Class.new(Error)
UnauthorizedError =
Class.new(Error)
Client =
Data::Client
VERSION =
'0.0.2'
UploadIO =
Faraday::UploadIO

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.log(message) ⇒ Object


33
34
35
36
# File 'lib/force/config.rb', line 33

def log(message)
  return unless Force.log?
  Force.configuration.logger.send :debug, message
end

Class Method Details

.configurationObject

Returns the current Configuration

Example

Force.configuration.username = "username"
Force.configuration.password = "password"

13
14
15
# File 'lib/force/config.rb', line 13

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields the Configuration

Example

Force.configure do |config|
  config.username = "username"
  config.password = "password"
end

Yields:


25
26
27
# File 'lib/force/config.rb', line 25

def configure
  yield configuration
end

.data(*args) ⇒ Object


51
52
53
# File 'lib/force.rb', line 51

def data(*args)
  Force::Data::Client.new(*args)
end

.decode_signed_request(*args) ⇒ Object

Helper for decoding signed requests.


60
61
62
# File 'lib/force.rb', line 60

def decode_signed_request(*args)
  SignedRequest.decode(*args)
end

.log?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'lib/force/config.rb', line 29

def log?
  @log ||= false
end

.new(*args) ⇒ Object

Alias for Force::Data::Client.new

Shamelessly pulled from github.com/pengwynn/octokit/blob/master/lib/octokit.rb


47
48
49
# File 'lib/force.rb', line 47

def new(*args)
  data(*args)
end

.tooling(*args) ⇒ Object


55
56
57
# File 'lib/force.rb', line 55

def tooling(*args)
  Force::Tooling::Client.new(*args)
end