Class: Cul::Image::Properties::Exif::TagEntry
- Inherits:
-
Object
- Object
- Cul::Image::Properties::Exif::TagEntry
- Defined in:
- lib/cul_image_props/image/properties/exif/types.rb
Overview
first element of tuple is tag name, optional second element is another dictionary giving names to values
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(name, value = false) ⇒ TagEntry
constructor
A new instance of TagEntry.
- #translate(values) ⇒ Object
- #translates? ⇒ Boolean
Constructor Details
#initialize(name, value = false) ⇒ TagEntry
Returns a new instance of TagEntry.
32 33 34 35 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 32 def initialize(name, value=false) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
31 32 33 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 31 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
31 32 33 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 31 def value @value end |
Instance Method Details
#translate(values) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 41 def translate(values) if @value if @value.respond_to? :call # value was a proc @value.call(values) else # value was a dictionary trans = '' values.each {|i| trans += (@value.include? i) ? @value[i] : i.inspect } trans end else values.inspect end end |
#translates? ⇒ Boolean
37 38 39 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 37 def translates? return (not ( @value.nil? or @value == false )) end |