Class: Hiera::Backend::Eyaml::Parser::EncBlockTokenType
- Inherits:
-
EncTokenType
- Object
- TokenType
- EncTokenType
- Hiera::Backend::Eyaml::Parser::EncBlockTokenType
- 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 ⇒ EncBlockTokenType
constructor
A new instance of EncBlockTokenType.
Methods inherited from EncTokenType
Constructor Details
#initialize ⇒ EncBlockTokenType
Returns a new instance of EncBlockTokenType.
132 133 134 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 132 def initialize @regex = %r{>\n(\s*)ENC\[(\w+,)?([a-zA-Z0-9+/=\s]+?)\]} end |
Instance Method Details
#create_token(string) ⇒ Object
136 137 138 139 |
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 136 def create_token(string) md = @regex.match(string) create_enc_token(string, :block, md[2], md[3], md[1]) end |