Class: SettingsReader::VaultResolver::Address
- Inherits:
-
Object
- Object
- SettingsReader::VaultResolver::Address
- Defined in:
- lib/settings_reader/vault_resolver/address.rb
Overview
Parsing of vault address
Instance Method Summary collapse
- #attribute ⇒ Object
- #full_path ⇒ Object
-
#initialize(uri) ⇒ Address
constructor
A new instance of Address.
- #mount ⇒ Object
- #no_cache? ⇒ Boolean
- #options ⇒ Object
- #path ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(uri) ⇒ Address
Returns a new instance of Address.
5 6 7 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 5 def initialize(uri) @uri = URI.parse(uri) end |
Instance Method Details
#attribute ⇒ Object
21 22 23 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 21 def attribute @uri.fragment end |
#full_path ⇒ Object
17 18 19 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 17 def full_path "#{mount}#{@uri.path}" end |
#mount ⇒ Object
9 10 11 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 9 def mount @uri.host end |
#no_cache? ⇒ Boolean
29 30 31 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 29 def no_cache? ['no_cache'] == 'true' end |
#options ⇒ Object
25 26 27 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 25 def URI.decode_www_form(@uri.query || '').to_h end |
#path ⇒ Object
13 14 15 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 13 def path @uri.path.delete_prefix('/') end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/settings_reader/vault_resolver/address.rb', line 33 def to_s @uri.to_s end |