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.


95
96
97
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 95

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

Instance Method Details

#create_token(string) ⇒ Object


98
99
100
101
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 98

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