Class: Hiera::Backend::Eyaml::Parser::DecBlockTokenType

Inherits:
TokenType
  • Object
show all
Defined in:
lib/hiera/backend/eyaml/parser/encrypted_tokens.rb

Instance Attribute Summary

Attributes inherited from TokenType

#regex

Instance Method Summary collapse

Constructor Details

#initializeDecBlockTokenType

Returns a new instance of DecBlockTokenType.



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

def initialize
  @regex = />\n(\s*)DEC(\(\d+\))?::(\w+)\[(.+?)\]\!/
end

Instance Method Details

#create_token(string) ⇒ Object



125
126
127
128
129
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 125

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