Class: Hiera::Backend::Eyaml::Parser::EncStringTokenType
- Inherits:
-
EncTokenType
- Object
- TokenType
- EncTokenType
- Hiera::Backend::Eyaml::Parser::EncStringTokenType
- Defined in:
- lib/hiera/backend/eyaml/parser/encrypted_tokens.rb
Instance Attribute Summary
Attributes inherited from TokenType
Instance Method Summary collapse
- #create_token(string) ⇒ Object
-
#initialize ⇒ EncStringTokenType
constructor
A new instance of EncStringTokenType.
Methods inherited from EncTokenType
Constructor Details
#initialize ⇒ EncStringTokenType
Returns a new instance of EncStringTokenType.
121 122 123 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 121 def initialize @regex = %r{ENC\[(\w+,)?([a-zA-Z0-9+/=]+?)\]} end |
Instance Method Details
#create_token(string) ⇒ Object
125 126 127 128 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 125 def create_token(string) md = @regex.match(string) create_enc_token(string, :string, md[1], md[2]) end |