Class: Petra::Proxies::Handlers::MissingMethodHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/petra/proxies/handlers/missing_method_handler.rb

Direct Known Subclasses

AttributeReadHandler

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(proxy) ⇒ MissingMethodHandler

Returns a new instance of MissingMethodHandler.



7
8
9
# File 'lib/petra/proxies/handlers/missing_method_handler.rb', line 7

def initialize(proxy)
  @proxy = proxy
end

Instance Attribute Details

#proxyObject (readonly)

Returns the value of attribute proxy.



11
12
13
# File 'lib/petra/proxies/handlers/missing_method_handler.rb', line 11

def proxy
  @proxy
end

Class Method Details

.add_constraint(position, other_handler) ⇒ Object

Adds a constraint to this handler class regarding the position it will end up in when actually executing the handlers.

Parameters:

  • position (:before, :after, :<, :>)
  • other_handler (String, Symbol)

    The other handler’s identifier



27
28
29
30
# File 'lib/petra/proxies/handlers/missing_method_handler.rb', line 27

def add_constraint(position, other_handler)
  method = position.to_sym == :before ? :< : :>
  constraints << [method, other_handler.to_sym]
end

.constraintsObject



15
16
17
# File 'lib/petra/proxies/handlers/missing_method_handler.rb', line 15

def constraints
  @constraints ||= []
end

Instance Method Details

#applicable?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/petra/proxies/handlers/missing_method_handler.rb', line 37

def applicable?
  not_implemented
end

#handleObject



41
42
43
# File 'lib/petra/proxies/handlers/missing_method_handler.rb', line 41

def handle(*)
  not_implemented
end

#queue_constraintsObject



33
34
35
# File 'lib/petra/proxies/handlers/missing_method_handler.rb', line 33

def queue_constraints
  not_implemented
end