Module: Hanami::View::Escape::Presentable

Defined in:
gems/gems/hanami-view-1.3.1/lib/hanami/view/escape.rb,
gems/gems/hanami-view-1.3.3/lib/hanami/view/escape.rb

Overview

Since:

  • 0.4.0

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &blk) ⇒ Object (protected)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Override Ruby's method_missing

Since:

  • 0.7.0

def method_missing(m, *args, &blk)
  if @object.respond_to?(m)
    ::Hanami::View::Escape.html(@object.__send__(m, *args, &blk))
  else
    super
  end
end

Instance Method Details

#initialize(object) ⇒ Object

Initialize the presenter

Parameters:

  • object (Object)

    the object to present

Since:

  • 0.7.0

def initialize(object)
  @object = object
end