lib/danica/dsl.rb in danica-2.7.4 vs lib/danica/dsl.rb in danica-2.7.5

- old
+ new

@@ -1,19 +1,21 @@ +# frozen_string_literal: true + module Danica module DSL autoload :Builder, 'danica/dsl/builder' class << self - def register_operator(method, clazz=nil) + def register_operator(method, clazz = nil) register(method, clazz, 'Danica::Operator') end - def register_wrapper(method, clazz=nil) + def register_wrapper(method, clazz = nil) register(method, clazz, 'Danica::Wrapper') end - def register(method, clazz=nil, base=nil) + def register(method, clazz = nil, base = nil) Builder.new(method, clazz, base).build end def register_class(method, clazz) define_method(method) do |*args| @@ -37,17 +39,17 @@ def function(*variables, &block) Function.build(*variables, &block).new end end - %i( + %i[ addition multiplication division sin cos power squared_root exponential - ).each do |method| + ].each do |method| DSL.register_operator(method) end - %i(number group negative plus_minus variable constant).each do |method| + %i[number group negative plus_minus variable constant].each do |method| DSL.register_wrapper(method) end DSL.register_wrapper :num, :Number DSL.register_operator :sum, :Addition