Class: Hanami::View::Rendering::Options Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hanami/view/rendering/options.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.

Rendering options

Since:

  • 1.1.1

Class Method Summary collapse

Class Method Details

.build(options, locals, format) ⇒ 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:

  • 1.1.1



13
14
15
16
17
18
19
20
# File 'lib/hanami/view/rendering/options.rb', line 13

def self.build(options, locals, format)
  options.dup.tap do |opts|
    opts[:format] ||= format
    opts[:locals] = locals
    opts[:locals].merge!(options.fetch(:locals) { ::Hash.new })
    opts[:locals].merge!(format: opts.fetch(:format, format))
  end
end