Class: Hiera::Backend::Eyaml::Parser::EncStringTokenType

Inherits:
EncTokenType show all
Defined in:
lib/hiera/backend/eyaml/parser/encrypted_tokens.rb

Instance Attribute Summary

Attributes inherited from TokenType

#regex

Instance Method Summary collapse

Methods inherited from EncTokenType

#create_enc_token

Constructor Details

#initializeEncStringTokenType

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