Module: Resync::Client::Mixins::Downloadable

Includes:
ClientDelegator
Included in:
ZippedResource, Link, Resource
Defined in:
lib/resync/client/mixins/downloadable.rb

Instance Attribute Summary

Attributes included from ClientDelegator

#client_delegate

Instance Method Summary collapse

Methods included from ClientDelegator

#client, #client=

Instance Method Details

#download_to_file(path) ⇒ Object

Delegates to Resync::Client#download_to_file to download the contents of :uri to the specified path.

Parameters:

  • path (String) —

    the path to download to



30
31
32
# File 'lib/resync/client/mixins/downloadable.rb', line 30

def download_to_file(path)
  client.download_to_file(uri: uri, path: path)
end

#download_to_temp_file ⇒ Object

Delegates to Resync::Client#download_to_temp_file to download the contents of :uri to a file.



23
24
25
# File 'lib/resync/client/mixins/downloadable.rb', line 23

def download_to_temp_file # rubocop:disable Style/AccessorMethodName
  client.download_to_temp_file(uri)
end

#get ⇒ Object

Delegates to Resync::Client#get to get the contents of this :uri



17
18
19
# File 'lib/resync/client/mixins/downloadable.rb', line 17

def get # rubocop:disable Style/AccessorMethodName
  client.get(uri)
end

#get_and_parse ⇒ Object

Delegates to Resync::Client#get_and_parse to get the contents of :uri as a ResourceSync document



12
13
14
# File 'lib/resync/client/mixins/downloadable.rb', line 12

def get_and_parse # rubocop:disable Style/AccessorMethodName
  client.get_and_parse(uri)
end