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.
31 32 33 34 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 31 def initialize(name, value=false) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
30 31 32 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 30 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
30 31 32 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 30 def value @value end |
Instance Method Details
#translate(values) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 40 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
36 37 38 |
# File 'lib/cul_image_props/image/properties/exif/types.rb', line 36 def translates? return (not ( @value.nil? or @value == false )) end |