Class: PhotoUtils::Tools::Reciprocity
- Inherits:
-
PhotoUtils::Tool
- Object
- PhotoUtils::Tool
- PhotoUtils::Tools::Reciprocity
- Defined in:
- lib/photo_utils/tools/reciprocity.rb
Instance Method Summary collapse
Methods inherited from PhotoUtils::Tool
#description, #initialize, #name
Constructor Details
This class inherits a constructor from PhotoUtils::Tool
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/photo_utils/tools/reciprocity.rb', line 17 def run if @args.first r = @args.first.split('-', 2).map { |n| n ? n.to_i : nil } else r = 1..100 end range = Range.new(r.first, r.last) ti = range.first until ti > range.last tc = Time.new(ti).reciprocity puts "#{ti} => #{tc.round.to_i}" ti *= 2 end end |
#usage ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/photo_utils/tools/reciprocity.rb', line 9 def usage %q{ -r 1 compute single value -r 2-60 compute values of 2 to 60 -r compute default range of 1-100 secs } end |