Class: XDG::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/xdg/environment.rb

Overview

A convenience wrapper to all XDG functionality.

Instance Method Summary collapse

Constructor Details

#initialize(home: Paths::Home, directories: Paths::Directory, environment: ENV) ⇒ Environment

Returns a new instance of Environment.



6
7
8
9
10
11
# File 'lib/xdg/environment.rb', line 6

def initialize home: Paths::Home, directories: Paths::Directory, environment: ENV
  @cache = Cache.new(home:, directories:, environment:)
  @config = Config.new(home:, directories:, environment:)
  @data = Data.new(home:, directories:, environment:)
  @state = State.new home:, directories:, environment:
end

Instance Method Details

#cache_homeObject



13
# File 'lib/xdg/environment.rb', line 13

def cache_home = cache.home

#config_dirsObject



17
# File 'lib/xdg/environment.rb', line 17

def config_dirs = config.directories

#config_homeObject



15
# File 'lib/xdg/environment.rb', line 15

def config_home = config.home

#data_dirsObject



21
# File 'lib/xdg/environment.rb', line 21

def data_dirs = data.directories

#data_homeObject



19
# File 'lib/xdg/environment.rb', line 19

def data_home = data.home

#inspectObject



29
# File 'lib/xdg/environment.rb', line 29

def inspect = "#<#{self.class}:#{object_id} #{self}>"

#state_homeObject



23
# File 'lib/xdg/environment.rb', line 23

def state_home = state.home

#to_sObject Also known as: to_str



25
# File 'lib/xdg/environment.rb', line 25

def to_s = "#{cache} #{config} #{data} #{state}"