Sha256: 782c458757892e02786895148804fec5327180aeffcfdae29ea81624bcab14d3

Contents?: true

Size: 463 Bytes

Versions: 4

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

require "refinements/structs"

module Rubysmith
  module CLI
    module Configuration
      module Enhancers
        # Adds current time to content.
        class CurrentTime
          using Refinements::Structs

          def initialize now = Time.now
            @now = now
          end

          def call(content) = content.merge(now: now)

          private

          attr_reader :now
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubysmith-0.16.1 lib/rubysmith/cli/configuration/enhancers/current_time.rb
rubysmith-0.16.0 lib/rubysmith/cli/configuration/enhancers/current_time.rb
rubysmith-0.15.0 lib/rubysmith/cli/configuration/enhancers/current_time.rb
rubysmith-0.14.0 lib/rubysmith/cli/configuration/enhancers/current_time.rb