module Ruby2JS::Filter::SecureRandom

Constants

IMPORT_BASE62_RANDOM

Public Instance Methods

on_send(node) click to toggle source
Calls superclass method
# File lib/ruby2js/filter/securerandom.rb, line 15
def on_send(node)
  target, method, *args = node.children

  if target == s(:const, nil, :SecureRandom)
    if method == :alphanumeric and args.length == 1
      prepend_list << IMPORT_BASE62_RANDOM
      node.updated(nil, [nil, :base62_random, *args])
    else
      super
    end
  else
    super
  end
end