Module: Hyperclient::ClassMethods

Defined in:
lib/hyperclient.rb

Instance Method Summary collapse

Instance Method Details

#auth(type, user, password) ⇒ void

This method returns an undefined value.

Sets the authentication options for your API client.

Parameters:

  • type

    A String or Symbol with the authentication method. Can be either :basic or :digest.

  • user

    A String with the user.

  • password

    A String with the password.



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

def auth(type, user, password)
  http_options({auth: {type: type, credentials: [user, password]}})
end

#entry_point(url) ⇒ void

This method returns an undefined value.

Set the entry point of your API.



39
40
41
# File 'lib/hyperclient.rb', line 39

def entry_point(url)
  Resource.entry_point = url
end

#http_options(options = {}) ⇒ Object

Returns a Hash with the HTTP options that will be used to initialize Hyperclient::HTTP.



57
58
59
60
61
62
# File 'lib/hyperclient.rb', line 57

def http_options(options = {})
  @@http_options ||= {}
  @@http_options.merge!(options)

  {http: @@http_options}
end