Class: Dato::Site::Client

Inherits:
Object
  • Object
show all
Includes:
ApiClient
Defined in:
lib/dato/site/client.rb

Instance Method Summary collapse

Methods included from ApiClient

#delete, #get, included, #json_schema, #method_missing, #post, #put, #request, #respond_to_missing?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dato::ApiClient

Instance Method Details

#create_upload_path(path_or_url) ⇒ Object



14
15
16
17
# File 'lib/dato/site/client.rb', line 14

def create_upload_path(path_or_url)
  file = Upload::CreateUploadPath.new(self, path_or_url)
  file.upload_path
end

#pusher_token(socket_id, channel) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/dato/site/client.rb', line 29

def pusher_token(socket_id, channel)
  request(
    :post,
    "/pusher/authenticate",
    { socket_id: socket_id, channel_name: channel },
  )
end

#upload_file(path_or_url, upload_attributes = {}, field_attributes = {}) ⇒ Object



19
20
21
22
# File 'lib/dato/site/client.rb', line 19

def upload_file(path_or_url, upload_attributes = {}, field_attributes = {})
  file = Upload::File.new(self, path_or_url, upload_attributes, field_attributes)
  file.upload
end

#upload_image(path_or_url, upload_attributes = {}, field_attributes = {}) ⇒ Object



24
25
26
27
# File 'lib/dato/site/client.rb', line 24

def upload_image(path_or_url, upload_attributes = {}, field_attributes = {})
  file = Upload::File.new(self, path_or_url, upload_attributes, field_attributes)
  file.upload
end