Module: BonsaiClient

Defined in:
lib/bonsai_client.rb,
lib/bonsai_client/client.rb,
lib/bonsai_client/version.rb

Defined Under Namespace

Classes: Client

Constant Summary collapse

VERSION =
'0.3.1'.freeze
NAME =
'bonsai_client'.freeze

Class Method Summary collapse

Class Method Details

.checksum_from_response(response) ⇒ String

Extract file checksum from response data.



31
32
33
# File 'lib/bonsai_client.rb', line 31

def self.checksum_from_response(response)
  response[:data][:file_checksum]
end

.create(opts = {}) ⇒ Client

Create a new client for a Bonsai server.

Options Hash (opts):

  • :url (String)

    Bonsai server URL (such as bonsai-server.com)

  • :client_id (String)

    Unique ID for each client



24
25
26
# File 'lib/bonsai_client.rb', line 24

def self.create(opts = {})
  Client.new(opts)
end