Class: ImageVoodoo::Directory
- Inherits:
-
Object
- Object
- ImageVoodoo::Directory
- Defined in:
- lib/image_voodoo/metadata.rb
Direct Known Subclasses
AdobeJpegDirectory, BmpHeaderDirectory, CanonMakernoteDirectory, CasioType1MakernoteDirectory, CasioType2MakernoteDirectory, ExifIFD0Directory, ExifInteropDirectory, ExifSubIFDDirectory, ExifThumbnailDirectory, FujifilmMakernoteDirectory, GifHeaderDirectory, GpsDirectory, IccDirectory, IptcDirectory, JfifDirectory, JpegCommentDirectory, JpegDirectory, KyoceraMakernoteDirectory, LeicaMakernoteDirectory, NikonType1MakernoteDirectory, NikonType2MakernoteDirectory, OlympusMakernoteDirectory, PanasonicMakernoteDirectory, PentaxMakernoteDirectory, PhotoshopDirectory, PngChromaticitiesDirectory, PngDirectory, PsdHeaderDirectory, RicohMakernoteDirectory, SanyoMakernoteDirectory, SigmaMakernoteDirectory, SonyType1MakernoteDirectory, SonyType6MakernoteDirectory, XmpDirectory
Instance Method Summary collapse
-
#[](tag_name) ⇒ Object
Return tag value for the tag specified or nil if there is none defined.
-
#exists? ⇒ Boolean
Does the directory you requested exist as metadata for this image.
-
#initialize(metadata) ⇒ Directory
constructor
A new instance of Directory.
Constructor Details
#initialize(metadata) ⇒ Directory
Returns a new instance of Directory.
51 52 53 |
# File 'lib/image_voodoo/metadata.rb', line 51 def initialize() @directory = .get_directory self.class.directory_class.java_class end |
Instance Method Details
#[](tag_name) ⇒ Object
Return tag value for the tag specified or nil if there is none defined.
64 65 66 67 68 69 70 71 |
# File 'lib/image_voodoo/metadata.rb', line 64 def [](tag_name) return nil unless @directory (tag_type, tag_method) = self.class::TAGS[tag_name.to_s] raise ArgumentError.new "Unkown tag_name: #{tag_name}" unless tag_type java_tag_type = self.class.directory_class.const_get tag_type return nil unless @directory.contains_tag java_tag_type @directory.__send__ tag_method, java_tag_type end |
#exists? ⇒ Boolean
Does the directory you requested exist as metadata for this image.
57 58 59 |
# File 'lib/image_voodoo/metadata.rb', line 57 def exists? !!@directory end |