Sha256: fb9addb2c4582a5fa9e342da23235b3e06b1dd4790282749bd0ff96ee7e6bf77
Contents?: true
Size: 458 Bytes
Versions: 14
Compression:
Stored size: 458 Bytes
Contents
# frozen_string_literal: true require "dry/monads" module Rubysmith module Configuration # Adds current time to content. module Transformers include Dry::Monads[:result] CurrentTime = lambda do |content, key = :now, at: Time.now| content.fetch(key) { at } .then { |value| content.merge! key => value } .then { |updated_content| Dry::Monads::Success updated_content } end end end end
Version data entries
14 entries across 14 versions & 1 rubygems