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.



120
121
122
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 120

def initialize
  @regex = /ENC\[(\w+,)?([a-zA-Z0-9\+\/=]+?)\]/
end

Instance Method Details

#create_token(string) ⇒ Object



123
124
125
126
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 123

def create_token(string)
  md = @regex.match(string)
  self.create_enc_token(string, :string, md[1], md[2])
end