Method: DiscourseApi::Client#initialize

Defined in:
lib/discourse_api/client.rb

#initialize(host, api_key = nil, api_username = nil) ⇒ Client

Returns a new instance of Client.

Raises:

  • (ArgumentError)


42
43
44
45
46
47
# File 'lib/discourse_api/client.rb', line 42

def initialize(host, api_key = nil, api_username = nil)
  raise ArgumentError, 'host needs to be defined' if host.nil? || host.empty?
  @host         = host
  @api_key      = api_key
  @api_username = api_username
end