Class: TaggedImage

Inherits:
TaggedFile show all
Includes:
Logging
Defined in:
lib/flickrup/filetype/tagged_image.rb

Constant Summary collapse

TYPE =
'image'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

logger, #logger, pre_init

Methods inherited from TaggedFile

#archive, create, #date_created, #doUpload, register_reader, #tags

Constructor Details

#initialize(filename) ⇒ TaggedImage

Returns a new instance of TaggedImage.



13
14
15
16
# File 'lib/flickrup/filetype/tagged_image.rb', line 13

def initialize(filename)
  super
  @filename = filename
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



11
12
13
# File 'lib/flickrup/filetype/tagged_image.rb', line 11

def filename
  @filename
end

Instance Method Details

#[](tag) ⇒ Object

Returns the value of a tag.



35
36
37
# File 'lib/flickrup/filetype/tagged_image.rb', line 35

def [] tag
  @parsed[tag]
end

#[]=(tag, val) ⇒ Object

Set the value of a tag.



40
41
42
# File 'lib/flickrup/filetype/tagged_image.rb', line 40

def []=(tag, val)
  @parsed[tag] = val
end

#post_uploadObject



26
27
28
29
30
31
32
# File 'lib/flickrup/filetype/tagged_image.rb', line 26

def post_upload
  super
  #maybe save afterwards
  if @parsed.changed?
    @parsed.save!
  end
end

#pre_uploadObject



18
19
20
21
22
23
24
# File 'lib/flickrup/filetype/tagged_image.rb', line 18

def pre_upload
  super
  #maybe save afterwards
  if @parsed.changed?
    @parsed.save!
  end
end

#typeObject



44
45
46
# File 'lib/flickrup/filetype/tagged_image.rb', line 44

def type
  TYPE
end