Class: GallerySync::FilePhoto

Inherits:
Photo
  • Object
show all
Defined in:
lib/gallery_sync/gallery_sync.rb

Instance Attribute Summary

Attributes inherited from Photo

#album

Instance Method Summary collapse

Methods inherited from Photo

#==, #name, #path

Constructor Details

#initialize(album, name, filepath) ⇒ FilePhoto

Returns a new instance of FilePhoto.



235
236
237
238
# File 'lib/gallery_sync/gallery_sync.rb', line 235

def initialize(album,name,filepath)
  super(album,name)
  @filepath = filepath
end

Instance Method Details

#fileObject



260
261
262
# File 'lib/gallery_sync/gallery_sync.rb', line 260

def file
  File.open(@filepath,"rb") {|io| io.read}
end

#full_urlObject



252
253
254
# File 'lib/gallery_sync/gallery_sync.rb', line 252

def full_url
  @filepath    
end

#medium_urlObject



248
249
250
# File 'lib/gallery_sync/gallery_sync.rb', line 248

def medium_url
  @filepath
end

#rmObject



240
241
242
# File 'lib/gallery_sync/gallery_sync.rb', line 240

def rm
  File.delete @filepath
end

#thumb_urlObject



244
245
246
# File 'lib/gallery_sync/gallery_sync.rb', line 244

def thumb_url
  @filepath
end

#to_sObject



256
257
258
# File 'lib/gallery_sync/gallery_sync.rb', line 256

def to_s
  "#{name} (#{@filepath})"
end