Class: EXIFR::TIFF::Degrees
- Inherits:
-
Array
- Object
- Array
- EXIFR::TIFF::Degrees
- Defined in:
- lib/exifr/tiff.rb
Instance Method Summary collapse
-
#initialize(arr) ⇒ Degrees
constructor
A new instance of Degrees.
- #to_f ⇒ Object
Constructor Details
#initialize(arr) ⇒ Degrees
Returns a new instance of Degrees.
333 334 335 336 337 338 |
# File 'lib/exifr/tiff.rb', line 333 def initialize(arr) unless arr.length == 3 && arr.all?{|v| Rational === v} raise "expected [degrees, minutes, seconds]; got #{arr.inspect}" end super end |
Instance Method Details
#to_f ⇒ Object
340 341 342 |
# File 'lib/exifr/tiff.rb', line 340 def to_f reduce { |m,v| m * 60 + v}.to_f / 3600 end |