Sha256: 2f2c922d7f601253c8dcee60586a53b68d9f256a8483ec7c931f51553d645332

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

class BasicObject
  def initialize(*)
  end

  def ==(other)
    `this === other`
  end

  def __send__(symbol, *args, &block)
    %x{
      var meth = this[mid_to_jsid(symbol)];

      return meth.apply(this, args);
    }
  end

  alias send __send__

  alias eql? ==
  alias equal? ==

  def instance_eval(string, &block)
    %x{
      if (block === nil) {
        no_block_given();
      }

      return block.call(this, this);
    }
  end

  def instance_exec(*args, &block)
    %x{
      if (block === nil) {
        no_block_given();
      }

      return block.apply(this, args);
    }
  end

  def method_missing(symbol, *args)
    raise NoMethodError, "undefined method `#{symbol}` for #{inspect}"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-0.3.20 core/basic_object.rb