lib/ncmb/file.rb in ncmb-ruby-client-0.1.2 vs lib/ncmb/file.rb in ncmb-ruby-client-0.1.3
- old
+ new
@@ -6,16 +6,21 @@
@fields = {acl: NCMB::Acl.new, file: file_path}
if file_path
@fields[:fileName] = File.basename(file_path)
@fields['mime-type'.to_sym] = MIME::Types.type_for(file_path)[0]
end
+ @content = nil
end
def save
@fields[:file] = open(self.file)
super
end
alias :update :save
+
+ def get
+ @content = @@client.get path
+ end
def path
"#{base_path}/#{@fields[:fileName]}"
end
\ No newline at end of file