forked from voxpupuli/hiera-eyaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoken.rb
More file actions
57 lines (46 loc) · 1.05 KB
/
Copy pathtoken.rb
File metadata and controls
57 lines (46 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Hiera
module Backend
module Eyaml
module Parser
class TokenType
attr_reader :regex
def create_token(_string)
raise 'Abstract method called'
end
end
class Token
attr_reader :match
def initialize(match)
@match = match
end
def to_encrypted(_args = {})
raise 'Abstract method called'
end
def to_decrypted(_args = {})
raise 'Abstract method called'
end
def to_plain_text
raise 'Abstract method called'
end
def to_s
"#{self.class.name}:#{@match}"
end
end
class NonMatchToken < Token
def initialize(non_match)
super
end
def to_encrypted(_args = {})
@match
end
def to_decrypted(_args = {})
@match
end
def to_plain_text
@match
end
end
end
end
end
end