Class: Runcom::Paths::Home
- Inherits:
-
Object
- Object
- Runcom::Paths::Home
- Extended by:
- Forwardable
- Defined in:
- lib/runcom/paths/home.rb
Overview
A XDG home path that prefers local over global path.
Instance Method Summary collapse
- #dynamic ⇒ Object
-
#initialize(pair, environment = ENV) ⇒ Home
constructor
A new instance of Home.
- #inspect ⇒ Object
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(pair, environment = ENV) ⇒ Home
Returns a new instance of Home.
13 14 15 16 |
# File 'lib/runcom/paths/home.rb', line 13 def initialize pair, environment = ENV @standard = XDG::Paths::Home.new pair, environment freeze end |
Instance Method Details
#dynamic ⇒ Object
18 19 20 21 |
# File 'lib/runcom/paths/home.rb', line 18 def dynamic String(value).then { |path| Pathname path } .then { |path| [path., standard.dynamic] } end |
#inspect ⇒ Object
29 |
# File 'lib/runcom/paths/home.rb', line 29 def inspect = "#<#{self.class}:#{object_id} #{self}>" |
#to_s ⇒ Object Also known as: to_str
23 24 25 |
# File 'lib/runcom/paths/home.rb', line 23 def to_s [standard.key, dynamic.join(XDG::Paths::Directory::DELIMITER)].compact.join XDG::DELIMITER end |