Class: Hanami::Extensions::View::PartHelpers Private

Inherits:
Object
  • Object
show all
Extended by:
SliceConfigurable
Includes:
StandardHelpers
Defined in:
lib/hanami/extensions/view/part.rb

Overview

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

Standalone helpers class including both StandardHelpers as well as the user-defined helpers for the slice.

Used where helpers should be addressed via an intermediary object (i.e. in parts), rather than mixed into a class directly.

Since:

  • 2.1.0

Constant Summary

Constants included from Helpers::AssetsHelper

Helpers::AssetsHelper::ABSOLUTE_URL_MATCHER, Helpers::AssetsHelper::CROSSORIGIN_ANONYMOUS, Helpers::AssetsHelper::DEFAULT_FAVICON, Helpers::AssetsHelper::FAVICON_MIME_TYPE, Helpers::AssetsHelper::FAVICON_REL, Helpers::AssetsHelper::JAVASCRIPT_EXT, Helpers::AssetsHelper::JAVASCRIPT_MIME_TYPE, Helpers::AssetsHelper::NEW_LINE_SEPARATOR, Helpers::AssetsHelper::QUERY_STRING_MATCHER, Helpers::AssetsHelper::STYLESHEET_EXT, Helpers::AssetsHelper::STYLESHEET_MIME_TYPE, Helpers::AssetsHelper::STYLESHEET_REL, Helpers::AssetsHelper::WILDCARD_EXT

Constants included from Helpers::FormHelper

Helpers::FormHelper::CSRF_TOKEN, Helpers::FormHelper::DEFAULT_CHARSET, Helpers::FormHelper::DEFAULT_METHOD

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SliceConfigurable

configure_for_slice, configured_for_slice?, configured_for_slices, extended

Methods included from Helpers::AssetsHelper

#asset_url, #audio_tag, #favicon_tag, #image_tag, #javascript_tag, #stylesheet_tag, #video_tag

Methods included from Helpers::FormHelper

#_form_csrf_token, #_form_for_params, #_form_for_values, #csrf_meta_tags, #form_for

Constructor Details

#initialize(context:) ⇒ PartHelpers

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.

Returns a new instance of PartHelpers.

Since:

  • 2.1.0



79
80
81
# File 'lib/hanami/extensions/view/part.rb', line 79

def initialize(context:)
  @_context = context
end

Instance Attribute Details

#_contextHanami::View::Context (readonly) Also known as: context

Returns the context for the current view rendering.

Returns:

  • (Hanami::View::Context)

    the context

Since:

  • 2.1.0



71
72
73
# File 'lib/hanami/extensions/view/part.rb', line 71

def _context
  @_context
end

Class Method Details

.configure_for_slice(slice) ⇒ Object

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.

Since:

  • 2.1.0



61
62
63
# File 'lib/hanami/extensions/view/part.rb', line 61

def self.configure_for_slice(slice)
  extend SliceConfiguredHelpers.new(slice)
end