Class: Exiftool::Result
- Inherits:
-
Object
- Object
- Exiftool::Result
- Defined in:
- lib/exiftool/result.rb
Instance Attribute Summary collapse
-
#symbol_display_hash ⇒ Object
readonly
Returns the value of attribute symbol_display_hash.
-
#to_display_hash ⇒ Object
readonly
Returns the value of attribute to_display_hash.
-
#to_hash ⇒ Object
readonly
Returns the value of attribute to_hash.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #errors? ⇒ Boolean
-
#initialize(raw_hash) ⇒ Result
constructor
A new instance of Result.
- #source_file ⇒ Object
Constructor Details
#initialize(raw_hash) ⇒ Result
Returns a new instance of Result.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/exiftool/result.rb', line 7 def initialize(raw_hash) @raw_hash = raw_hash @to_hash = {} @to_display_hash = {} @symbol_display_hash = {} @raw_hash.each do |key, raw_value| p = Parser.new(key, raw_value) @to_hash[p.sym_key] = p.value @to_display_hash[p.display_key] = p.value @symbol_display_hash[p.sym_key] = p.display_key end end |
Instance Attribute Details
#symbol_display_hash ⇒ Object (readonly)
Returns the value of attribute symbol_display_hash.
5 6 7 |
# File 'lib/exiftool/result.rb', line 5 def symbol_display_hash @symbol_display_hash end |
#to_display_hash ⇒ Object (readonly)
Returns the value of attribute to_display_hash.
5 6 7 |
# File 'lib/exiftool/result.rb', line 5 def to_display_hash @to_display_hash end |
#to_hash ⇒ Object (readonly)
Returns the value of attribute to_hash.
5 6 7 |
# File 'lib/exiftool/result.rb', line 5 def to_hash @to_hash end |
Instance Method Details
#[](key) ⇒ Object
20 21 22 |
# File 'lib/exiftool/result.rb', line 20 def [](key) @to_hash[key] end |
#errors? ⇒ Boolean
28 29 30 |
# File 'lib/exiftool/result.rb', line 28 def errors? self[:error] == 'Unknown file type' || self[:warning] == 'Unsupported file type' end |
#source_file ⇒ Object
24 25 26 |
# File 'lib/exiftool/result.rb', line 24 def source_file self[:source_file] end |