Class: Hiera::Backend::Eyaml::Parser::DecStringTokenType

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

#initializeDecStringTokenType

Returns a new instance of DecStringTokenType.


115
116
117
# File 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb', line 115

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

Instance Method Details

#create_token(string) ⇒ Object


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

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