Sha256: 49d030ad3486e11cf6df7c6267c24998290aa2466bd5f5665350f8e8cc684944

Contents?: true

Size: 374 Bytes

Versions: 4

Compression:

Stored size: 374 Bytes

Contents

# frozen_string_literal: true

module Runcom
  # A common context for all XDG custom objects.
  Context = Struct.new :defaults, :home, :environment, :xdg, keyword_init: true do
    def initialize *arguments
      super

      self[:home] ||= Paths::Home
      self[:environment] ||= ENV
      self[:xdg] = xdg.new(home:, environment:) if xdg

      freeze
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
runcom-9.0.3 lib/runcom/context.rb
runcom-9.0.2 lib/runcom/context.rb
runcom-9.0.1 lib/runcom/context.rb
runcom-9.0.0 lib/runcom/context.rb