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.



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

def initialize(filename)
  super
  @filename = filename
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

Instance Method Details

#[](tag) ⇒ Object

Returns the value of a tag.



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

def [] tag
  @parsed[tag]
end

#[]=(tag, val) ⇒ Object

Set the value of a tag.



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

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

#post_uploadObject



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

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

#pre_uploadObject



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

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

#typeObject



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

def type
  TYPE
end