Class TaliaCore::DummyHandler
In: lib/talia_core/dummy_handler.rb
Parent: Object

This is an internal class for "dummy handler invocations" on sources The problem is that invocations like source.namespace::name are evaluated to (source.namespace).name This means that source.namespace must return an object on which "name" can be called with the desired effect. This object is the "dummy handler"

Methods

Public Class methods

Create the new handler

[Source]

    # File lib/talia_core/dummy_handler.rb, line 17
17:     def initialize(namespace, subject)
18:       assit_kind_of(N::URI, namespace)
19:       assit_kind_of(TaliaCore::Source, subject)
20:       
21:       @namespace = namespace.to_s
22:       @subject = subject
23:     end

Public Instance methods

Catch the invocations

[Source]

    # File lib/talia_core/dummy_handler.rb, line 26
26:     def method_missing(method, *args)
27:       # read value
28:       raise(ArgumentError, "Wrong number of arguments") if(args.size != 0)
29:       @subject[@namespace + method.to_s]
30:     end

[Validate]