Class: Hiera::Backend::Eyaml::Parser::DecBlockTokenType
- 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 ⇒ DecBlockTokenType
constructor
A new instance of DecBlockTokenType.
Constructor Details
#initialize ⇒ DecBlockTokenType
Returns a new instance of DecBlockTokenType.
157 158 159 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 157 def initialize @regex = />\n(\s*)DEC(\(\d+\))?::(\w+)\[(.+?)\]\!/m end |
Instance Method Details
#create_token(string) ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 160 def create_token(string) md = @regex.match(string) if (EncToken.encrypt_unchanged == false) unless md[2].nil? if md[4] == EncToken.tokens_map[md[2]] return EncToken.plain_text_value(:string, md[4], md[3], string, md[2]) end end end EncToken.decrypted_value(:block, md[4], md[3], string, md[2], md[1]) end |