Module: Inform::Behavior
- Defined in:
- lib/runtime/experimental/handler_dsl.rb
Overview
The Inform::Behavior module
Constant Summary collapse
Class Method Summary collapse
Class Method Details
.attach(obj) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/runtime/experimental/handler_dsl.rb', line 53 def self.attach(obj) if (mod = Inform::Behavior::REGISTRY[key_for(obj)]) obj.extend(mod) end obj end |
.key_for(obj) ⇒ Object
43 44 45 46 47 |
# File 'lib/runtime/experimental/handler_dsl.rb', line 43 def self.key_for(obj) return obj.identity if obj.respond_to?(:identity) && !(obj.identity.nil? || obj.identity.empty?) "<##{obj.class}:#{obj.name}>" end |