class Adorn::AbstractPresenter

Public Class Methods

new(*) click to toggle source
# File lib/adorn/abstract_presenter.rb, line 27
def initialize(*);end
presents(name) click to toggle source

Macro used to create an instance method that wraps the underlying object passed to the decorator

@param [Symbol] @return [Method] Adorn instance.

# File lib/adorn/abstract_presenter.rb, line 9
def self.presents(name)
  define_method(name) { @object }
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source

Check both the context and the object before passing exception along @return [Method, StandardError]

Calls superclass method
# File lib/adorn/abstract_presenter.rb, line 15
def method_missing(method, *args, &block)
  @context.send(method, *args, &block) if @context.respond_to?(method)
  @object.send(method, *args, &block) if @object.respond_to?(method)
rescue => e
  super(method, *args, &block)
end
respond_to_missing?(method,*) click to toggle source
Calls superclass method
# File lib/adorn/abstract_presenter.rb, line 22
def respond_to_missing?(method,*)
  method =~ /#{method.to_s}/ || super
end