Class: Snails::AppPath
- Defined in:
- runtime/snails/root_path.rb,
runtime/snails/root_path.rbs
Overview
A path value returned by Snails.root.
It is not a String subclass, so the runtime stays statically resolvable.
The surface is what app code needs from a path: interpolation, join,
+, and the implicit conversion File methods use.
Instance Method Summary collapse
-
#+(part) ⇒ AppPath
a path join, not string concatenation.
-
#initialize(base) ⇒ AppPath
constructor
A new instance of AppPath.
-
#join(*parts) ⇒ AppPath
appends path parts with one separator between each.
-
#to_path ⇒ String
the implicit conversion
Filemethods look for. -
#to_s ⇒ String
the accumulated path, which is what interpolation prints.
Constructor Details
#initialize(base) ⇒ AppPath
Returns a new instance of AppPath.
7 |
# File 'runtime/snails/root_path.rbs', line 7
def initialize: (String base) -> void
|
Instance Method Details
#+(part) ⇒ AppPath
a path join, not string concatenation.
49 |
# File 'runtime/snails/root_path.rb', line 49
def +: (String part) -> AppPath
|
#join(*parts) ⇒ AppPath
appends path parts with one separator between each.
With no parts it answers this path unchanged, so Snails.root.join is
Snails.root.
37 |
# File 'runtime/snails/root_path.rb', line 37
def join: (*String parts) -> AppPath
|
#to_path ⇒ String
the implicit conversion File methods look for.
It is to_path, not to_str: a path value does not pose as a String.
65 |
# File 'runtime/snails/root_path.rb', line 65
def to_path: () -> String
|
#to_s ⇒ String
the accumulated path, which is what interpolation prints.
56 |
# File 'runtime/snails/root_path.rb', line 56
def to_s: () -> String
|