lib/danica/wrapper.rb in danica-2.7.4 vs lib/danica/wrapper.rb in danica-2.7.5
- old
+ new
@@ -1,7 +1,17 @@
+# frozen_string_literal: true
+
module Danica
module Wrapper
+ autoload :Number, 'danica/wrapper/number'
+ autoload :Group, 'danica/wrapper/group'
+ autoload :Negative, 'danica/wrapper/negative'
+ autoload :PlusMinus, 'danica/wrapper/plus_minus'
+ autoload :Constant, 'danica/wrapper/constant'
+ autoload :Variable, 'danica/wrapper/variable'
+ autoload :Container, 'danica/wrapper/container'
+
def wrap_value(value)
Wrapper.wrap_value(value)
end
def self.wrap_value(value)
@@ -24,18 +34,10 @@
return Negative.new(Number.new(-number)) if number < 0
Number.new(number)
end
def self.wrap_hash(hash)
- return Constant.new(hash) if hash.keys.map(&:to_sym).sort == %i(gnuplot latex value)
+ return Constant.new(hash) if hash.keys.map(&:to_sym).sort == %i[gnuplot latex value]
Variable.new(hash)
end
-
- autoload :Number, 'danica/wrapper/number'
- autoload :Group, 'danica/wrapper/group'
- autoload :Negative, 'danica/wrapper/negative'
- autoload :PlusMinus, 'danica/wrapper/plus_minus'
- autoload :Constant, 'danica/wrapper/constant'
- autoload :Variable, 'danica/wrapper/variable'
- autoload :Container, 'danica/wrapper/container'
end
end