Sha256: 8ca1181f9e057845434859db5a3a01fe2c5ef7994227e58c969585050060190b

Contents?: true

Size: 664 Bytes

Versions: 1

Compression:

Stored size: 664 Bytes

Contents

# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
# License:   Apache License, Version 2.0

module Superiseable

  def superised
    @superised = true
  end
  
  def method_added(method_name)
    if @superised
      superising method_name
    end
    @superised = false
  end
  
  def superising method_name
    @superized_methods ||= []
    @superized_methods << method_name
  end
  
  def register_java_implementation(klass)
    self.included(klass) if self.respond_to?(:included)
    return unless @superized_methods
    @superized_methods.each do |method_name|
      klass.class_eval("def #{method_name}(*args); super; end")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rtm-javatmapi-0.3.0 lib/rtm/javatmapi/superiseable.rb