Module: Resync::Downloadable

Included in:
Link, Resource
Defined in:
lib/resync/client/downloadable.rb

Overview

Adds get, get_raw, and get_file methods, delegating to the injected client.

See Also:

Instance Method Summary collapse

Instance Method Details

#download_to_file(path) ⇒ Object

Delegates to 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/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 Client#download_to_temp_file to download the contents of :uri to a file.



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

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

#get ⇒ Object

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



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

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

#get_and_parse ⇒ Object

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



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

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