Module: Coach4rb

Defined in:
lib/coach4rb.rb,
lib/coach4rb/proxy.rb,
lib/coach4rb/coach.rb,
lib/coach4rb/client.rb,
lib/coach4rb/version.rb,
lib/coach4rb/privacy.rb,
lib/coach4rb/builder.rb,
lib/coach4rb/resource/page.rb,
lib/coach4rb/resource/user.rb,
lib/coach4rb/mixin/as_hash.rb,
lib/coach4rb/resource/sport.rb,
lib/coach4rb/resource/entry.rb,
lib/coach4rb/mixin/iterable.rb,
lib/coach4rb/response_parser.rb,
lib/coach4rb/resource/entity.rb,
lib/coach4rb/mixin/basic_auth.rb,
lib/coach4rb/mixin/track_reader.rb,
lib/coach4rb/mixin/track_writer.rb,
lib/coach4rb/json_response_parser.rb,
lib/coach4rb/resource/partnership.rb,
lib/coach4rb/resource/subscription.rb,
lib/coach4rb/mixin/auto_constructor.rb

Defined Under Namespace

Modules: Builder, Mixin, Privacy, Proxy, Resource Classes: Client, Coach, JsonResponseParser, ResponseParser

Constant Summary

VERSION =
"0.0.3"

Class Method Summary (collapse)

Class Method Details

+ (Coach) configure(config)

Creates a Coach4rb client given the configuration hash config.

Example

Examples:

@client = Coach4rb::Client.new(
    scheme: 'http',
    host:  'diufvm31.unifr.ch',
    port:  8090,
    path:  '/CyberCoachServer/resources'
)

Parameters:

  • config (Hash)

Returns:



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/coach4rb.rb', line 50

def self.configure(config)
  client = Client.new(
      scheme: config[:scheme],
      host: config[:host],
      port: config[:port],
      path: config[:path]
  )

  config[:debug] ||= false

  response_parser = JsonResponseParser.new
  Coach.new(client, response_parser, config[:debug])
end