lib/alephant/renderer.rb in alephant-renderer-3.0.0 vs lib/alephant/renderer.rb in alephant-renderer-3.1.0

- old
+ new

@@ -1,8 +1,8 @@ -require "alephant/renderer/version" -require "alephant/renderer/view_mapper" -require "alephant/logger" +require 'alephant/renderer/version' +require 'alephant/renderer/view_mapper' +require 'alephant/logger' module Alephant module Renderer def self.create(config, data) Renderer.new(config, data) @@ -23,19 +23,18 @@ end private def mapper - @mapper ||= ViewMapper.new( - config[:renderer_id], - config[:view_path] - ).tap do + @mapper ||= begin logger.info( - "event" => "ViewMapperCreated", - "rendererId" => config[:renderer_id], - "viewPath" => config[:view_path], - "method" => "#{self.class}#mapper" + event: :ViewMapperCreated, + rendererId: config[:renderer_id], + viewPath: config[:view_path], + method: "#{self.class}#mapper" ) + + ViewMapper.new(config[:renderer_id], config[:view_path]) end end end end end