Refactoring and documentation

This commit is contained in:
Andy Meneely
2014-12-31 09:17:21 -05:00
parent 574f99af12
commit 0da51b4573
7 changed files with 18 additions and 9 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ module Squib
# data = csv file: 'data.csv'
# => {'h1' => [1,3], 'h2' => [2,4]}
#
# Parsing uses Ruby's CSV, options: {headers: true, converters: :numeric}
# Parsing uses Ruby's CSV, with options `{headers: true, converters: :numeric}`
# http://www.ruby-doc.org/stdlib-2.0/libdoc/csv/rdoc/CSV.html
#
# @option opts file [String] the CSV-formatted file to open. Opens relative to the current directory.
+3 -2
View File
@@ -1,3 +1,5 @@
require 'squib/constants'
module Squib
class Deck
@@ -13,7 +15,6 @@ module Squib
@dpi * n.to_f
end
@@INCHES_IN_CM = 0.393700787
# Given cm, returns the number of pixels according to the deck's DPI.
#
# @example
@@ -23,7 +24,7 @@ module Squib
# @return [Decimal] the number of pixels, according to the deck's DPI
# @api public
def cm(n)
@dpi * @@INCHES_IN_CM * n.to_f
@dpi * Squib::INCHES_IN_CM * n.to_f
end
end