Top Level Namespace

Defined Under Namespace

Modules: DecimalSupport Classes: Decimal

Constant Summary collapse

D =
Decimal

Instance Method Summary collapse

Instance Method Details

#D(*args) ⇒ Object



4
5
6
# File 'lib/decimal/shortcut.rb', line 4

def D(*args)
  Decimal(*args)
end

#Decimal(*args) ⇒ Object

Decimal constructor. See Decimal#new for the parameters. If a Decimal is passed a reference to it is returned (no new object is created).



4165
4166
4167
4168
4169
4170
4171
# File 'lib/decimal/decimal.rb', line 4165

def Decimal(*args)
  if args.size==1 && args.first.instance_of?(Decimal)
    args.first
  else
    Decimal.new(*args)
  end
end