Class: Hiera::Backend::Eyaml::Parser::EncBlockTokenType

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

#initializeEncBlockTokenType

Returns a new instance of EncBlockTokenType.



102
103
104
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 102

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

Instance Method Details

#create_token(string) ⇒ Object



105
106
107
108
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 105

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