lib/contextio/source_sync_data.rb in contextio-1.8.0 vs lib/contextio/source_sync_data.rb in contextio-1.8.1
- old
+ new
@@ -2,15 +2,15 @@
class ContextIO
class SourceSyncData
attr_reader :folder_names, :folders, :source_label
- def initialize(source_label, folder_hash)
+ def initialize(source_label, folder_hash = nil)
@folder_hash = folder_hash
@source_label = source_label
- @folder_names = folder_hash.keys
+ @folder_names = (folder_hash || {}).keys
- @folders = folder_hash.collect do |folder_name, attr_hash|
+ @folders = (folder_hash || {}).collect do |folder_name, attr_hash|
ContextIO::FolderSyncData.new(folder_name, attr_hash)
end
end
private