class XDG::Paths::Home
A XDG
home path.
Constants
- KEY
Public Class Methods
Source
# File lib/xdg/paths/home.rb, line 16 def initialize pair, environment = ENV @pair = pair @environment = environment freeze end
Public Instance Methods
Source
# File lib/xdg/paths/home.rb, line 22 def default = expand String(value) def dynamic = String(environment[key]).then { |path| path.empty? ? default : expand(path) } def to_s = [pair.key, dynamic].compact.join XDG::DELIMITER alias to_str to_s def inspect = "#<#{self.class}:#{object_id} #{self}>" private attr_reader :pair, :environment def expand(path) = home.join(path).expand_path def home = Pathname environment.fetch(KEY)
Source
# File lib/xdg/paths/home.rb, line 24 def dynamic = String(environment[key]).then { |path| path.empty? ? default : expand(path) } def to_s = [pair.key, dynamic].compact.join XDG::DELIMITER alias to_str to_s def inspect = "#<#{self.class}:#{object_id} #{self}>" private attr_reader :pair, :environment def expand(path) = home.join(path).expand_path def home = Pathname environment.fetch(KEY) end
Source
# File lib/xdg/paths/home.rb, line 36 def expand(path) = home.join(path).expand_path def home = Pathname environment.fetch(KEY) end end
Source
# File lib/xdg/paths/home.rb, line 38 def home = Pathname environment.fetch(KEY) end
Source
# File lib/xdg/paths/home.rb, line 30 def inspect = "#<#{self.class}:#{object_id} #{self}>" private attr_reader :pair, :environment def expand(path) = home.join(path).expand_path def home = Pathname environment.fetch(KEY) end end end
Source
# File lib/xdg/paths/home.rb, line 26 def to_s = [pair.key, dynamic].compact.join XDG::DELIMITER alias to_str to_s def inspect = "#<#{self.class}:#{object_id} #{self}>" private attr_reader :pair, :environment def expand(path) = home.join(path).expand_path def home = Pathname environment.fetch(KEY) end end