datocms/ruby-datocms-client

The client initialization howto

Closed this issue · 1 comments

Hello, how do I initialize the client? The documentation here seems to be inaccurate, the initializer in Dato::Site::Client takes no arguments.
Thanks

Hi @bosskovic, actually the class takes 2 arguments, token and options:

define_method(:initialize) do |token, options = {}|
@token = token
@base_url = options[:base_url] || "https://#{subdomain}.datocms.com"
@environment = options[:environment]
@extra_headers = options[:extra_headers] || {}
end