module Pakyow::Presenter::Presentable

Public Instance Methods

method_missing(method_name, *args, &block) click to toggle source
Calls superclass method
# File lib/pakyow/presenter/presentable.rb, line 6
def method_missing(method_name, *args, &block)
  if presentable?(method_name)
    @presentables[args.unshift(method_name).join(":").to_sym]
  else
    super
  end
end
respond_to_missing?(method_name, include_private = false) click to toggle source
Calls superclass method
# File lib/pakyow/presenter/presentable.rb, line 14
def respond_to_missing?(method_name, include_private = false)
  presentable?(method_name) || super
end

Private Instance Methods

presentable?(presentable_key) click to toggle source
# File lib/pakyow/presenter/presentable.rb, line 20
def presentable?(presentable_key)
  presentable_key = presentable_key.to_s
  instance_variable_defined?(:@presentables) && @presentables.any? { |key, _|
    key.to_s.start_with?(presentable_key)
  }
end