lib/nsisam/client.rb in nsisam-0.6.1 vs lib/nsisam/client.rb in nsisam-0.6.2
- old
+ new
@@ -108,11 +108,11 @@
# nsisam.get_file("some key")
# nsisam.store_file("test", :doc) # stored at key 'test_key'
# nsisam.get_file("test_key", :doc)
def get_file(key, type=:file, expected_checksum = nil)
response = get(key, expected_checksum)
- Response.new(
+ response = Response.new(
'key' => response.key,
'checksum' => response.checksum,
'filename' => response.data['filename'],
'file' => Base64.decode64(response.data[type.to_s]),
'deleted' => response.deleted?)
@@ -147,12 +147,12 @@
#
# @example
# nsisam.update_file("my key", "my value")
# nsisam.update_file("my key", "my value", :video)
# nsisam.update_file("my key", "my value", :doc)
- def update_file(key, type=:file, new_content)
+ def update_file(key, type=:file, new_content, filename)
encoded = Base64.encode64(new_content)
- update(key, type => encoded)
+ update(key, type => encoded, filename: filename)
end
# Pre-configure the NSISam module with default params for the NSISam::Client
#
# @yield a Configuration object (see {NSISam::Client::Configuration})