Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/photo_utils/extensions/numeric.rb

Instance Method Summary collapse

Instance Method Details

#feetObject



7
8
9
# File 'lib/photo_utils/extensions/numeric.rb', line 7

def feet
  PhotoUtils::Length.new(self.to_f * 12 / INCHES_PER_METER * 1000)
end

#inchesObject



11
12
13
# File 'lib/photo_utils/extensions/numeric.rb', line 11

def inches
  PhotoUtils::Length.new(self.to_f / INCHES_PER_METER * 1000)
end

#metersObject



15
16
17
# File 'lib/photo_utils/extensions/numeric.rb', line 15

def meters
  PhotoUtils::Length.new(self * 1000)
end

#mmObject



19
20
21
# File 'lib/photo_utils/extensions/numeric.rb', line 19

def mm
  PhotoUtils::Length.new(self)
end