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

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

Overview

A downloadable resource or link.

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.



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

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

#download_to_temp_fileObject

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



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

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

#getObject

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



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

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

#get_and_parseObject

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



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

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