Sha256: b07220933dd4fecda8b0968362a6e203307f307a737e7d2c22510f6ae5c0fa21

Contents?: true

Size: 1.2 KB

Versions: 16

Compression:

Stored size: 1.2 KB

Contents

# This file ended up in Opal as a port of:
# https://github.com/ruby/ruby2_keywords/blob/master/lib/ruby2_keywords.rb

class Module
  unless private_method_defined?(:ruby2_keywords)
    private
    # call-seq:
    #    ruby2_keywords(method_name, ...)
    #
    # Does nothing.
    def ruby2_keywords(name, *)
      # nil
    end
  end
end

main = TOPLEVEL_BINDING.eval('self')
unless main.respond_to?(:ruby2_keywords, true)
  # call-seq:
  #    ruby2_keywords(method_name, ...)
  #
  # Does nothing.
  def main.ruby2_keywords(name, *)
    # nil
  end
end

class Proc
  unless method_defined?(:ruby2_keywords)
    # call-seq:
    #    proc.ruby2_keywords -> proc
    #
    # Does nothing and just returns the receiver.
    def ruby2_keywords
      self
    end
  end
end

class << Hash
  unless method_defined?(:ruby2_keywords_hash?)
    # call-seq:
    #    Hash.ruby2_keywords_hash?(hash) -> false
    #
    # Returns false.
    def ruby2_keywords_hash?(hash)
      false
    end
  end

  unless method_defined?(:ruby2_keywords_hash)
    # call-seq:
    #    Hash.ruby2_keywords_hash(hash) -> new_hash
    #
    # Duplicates a given hash and returns the new hash.
    def ruby2_keywords_hash(hash)
      hash.dup
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 stdlib/ruby2_keywords.rb
opal-1.8.2 stdlib/ruby2_keywords.rb
opal-1.8.1 stdlib/ruby2_keywords.rb
opal-1.8.0 stdlib/ruby2_keywords.rb
opal-1.8.0.beta1 stdlib/ruby2_keywords.rb
opal-1.7.4 stdlib/ruby2_keywords.rb
opal-1.8.0.alpha1 stdlib/ruby2_keywords.rb
opal-1.7.3 stdlib/ruby2_keywords.rb
opal-1.7.2 stdlib/ruby2_keywords.rb
opal-1.7.1 stdlib/ruby2_keywords.rb
opal-1.7.0 stdlib/ruby2_keywords.rb
opal-1.7.0.rc1 stdlib/ruby2_keywords.rb
opal-1.6.1 stdlib/ruby2_keywords.rb
opal-1.6.0 stdlib/ruby2_keywords.rb
opal-1.6.0.rc1 stdlib/ruby2_keywords.rb
opal-1.6.0.alpha1 stdlib/ruby2_keywords.rb