Class: Flickrie::Media::Exif
- Inherits:
-
Object
- Object
- Flickrie::Media::Exif
- Defined in:
- lib/flickrie/objects/media/exif.rb
Instance Attribute Summary collapse
- #hash ⇒ Hash readonly
Instance Method Summary collapse
Instance Attribute Details
#hash ⇒ Hash (readonly)
26 27 28 |
# File 'lib/flickrie/objects/media/exif.rb', line 26 def hash @hash end |
Instance Method Details
#[](key) ⇒ Object
24 |
# File 'lib/flickrie/objects/media/exif.rb', line 24 def [](key) @info[key] end |
#get(key, options = {}) ⇒ Object
Gets exif. Example:
photo.exif.get('Model') # => 'Canon PowerShot G12'
photo.exif.get('X-Resolution', data: 'raw') # => '180'
photo.exif.get('X-Resolution', data: 'clean') # => '180 dpi'
photo.exif.get('X-Resolution') # => '180 dpi'
15 16 17 18 19 20 21 22 |
# File 'lib/flickrie/objects/media/exif.rb', line 15 def get(key, = {}) hash = @info.find { |hash| hash['label'] == key } data = hash[[:data]] || hash['clean'] || hash['raw'] data['_content'] rescue NoMethodError nil end |