Module: Dato::ApiClient::ClassMethods

Defined in:
lib/dato/api_client.rb

Instance Method Summary collapse

Instance Method Details

#json_schema(subdomain) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dato/api_client.rb', line 26

def json_schema(subdomain)
  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

  define_singleton_method(:subdomain) do
    subdomain
  end
end