class Object

Public Instance Methods

merge(*args) click to toggle source
Calls superclass method
# File lib/asciidoctor/core_ext/hash/merge.rb, line 5
def merge *args
  (len = args.length) < 1 ? dup : (len > 1 ? args.inject(self) {|acc, arg| acc.merge arg } : (super args[0]))
end
truncate(*args) click to toggle source
Calls superclass method
# File lib/asciidoctor/core_ext/float/truncate.rb, line 5
def truncate *args
  if args.length == 1
    if (precision = Integer args.shift) == 0
      super
    elsif precision > 0
      precision_factor = 10.0 ** precision
      (self * precision_factor).to_i / precision_factor
    else
      precision_factor = 10 ** precision.abs
      (self / precision_factor).to_i * precision_factor
    end
  else
    super
  end
end