Class: Hiera::Backend::Eyaml::Parser::DecStringTokenType
- 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 ⇒ DecStringTokenType
constructor
A new instance of DecStringTokenType.
Constructor Details
#initialize ⇒ DecStringTokenType
Returns a new instance of DecStringTokenType.
115 116 117 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 115 def initialize @regex = /DEC(\(\d+\))?::(\w+)\[(.+?)\]\!/m end |
Instance Method Details
#create_token(string) ⇒ Object
118 119 120 121 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 118 def create_token(string) md = @regex.match(string) EncToken.decrypted_value(:string, md[3], md[2], string, md[1]) end |