Module: Superiseable
- Included in:
- Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Construct, Java::OrgTmapiCore::DatatypeAware, Java::OrgTmapiCore::Locator, Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Reifiable, Java::OrgTmapiCore::Role, Java::OrgTmapiCore::Scoped, Java::OrgTmapiCore::Topic, Java::OrgTmapiCore::TopicMap, Java::OrgTmapiCore::Typed, Java::OrgTmapiCore::Variant, RTM::JavaTMAPI
- Defined in:
- lib/rtm/javatmapi/superiseable.rb
Overview
Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig. License: Apache License, Version 2.0
Instance Method Summary collapse
- #method_added(method_name) ⇒ Object
- #register_java_implementation(klass) ⇒ Object
- #superised ⇒ Object
- #superising(method_name) ⇒ Object
Instance Method Details
#method_added(method_name) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/rtm/javatmapi/superiseable.rb', line 10 def method_added(method_name) if @superised superising method_name end @superised = false end |
#register_java_implementation(klass) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rtm/javatmapi/superiseable.rb', line 22 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") impl = self.instance_method(method_name) klass.class_eval do define_method method_name, impl end end end |
#superised ⇒ Object
6 7 8 |
# File 'lib/rtm/javatmapi/superiseable.rb', line 6 def superised @superised = true end |
#superising(method_name) ⇒ Object
17 18 19 20 |
# File 'lib/rtm/javatmapi/superiseable.rb', line 17 def superising method_name @superized_methods ||= [] @superized_methods << method_name end |