forked from Arinzeokeke/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hacker.go
55 lines (46 loc) · 1.16 KB
/
hacker.go
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
package faker
// Hackier Interface
type Hackier interface {
Abbreviation() string
Adjective() string
Noun() string
Verb() string
Ingverb() string
Phrase() string
}
// Hacker struct
type Hacker struct {
*Fake
}
// Abbreviation Returns an abbreviation
func (h *Hacker) Abbreviation() string {
return h.pick(hackerPrefix + "/abbreviation")
}
// Adjective Returns an adjective
func (h *Hacker) Adjective() string {
return h.pick(hackerPrefix + "/adjective")
}
// Noun Returns a noun
func (h *Hacker) Noun() string {
return h.pick(hackerPrefix + "/noun")
}
// Verb Returns a verb
func (h *Hacker) Verb() string {
return h.pick(hackerPrefix + "/verb")
}
// Ingverb Returns an ingverb
func (h *Hacker) Ingverb() string {
return h.pick(hackerPrefix + "/ingverb")
}
// Phrase Returns a phrase made up of other hacker verbs
func (h *Hacker) Phrase() string {
hackerData := map[string]string{
"abbreviation": h.Hacker().Abbreviation(),
"adjective": h.Hacker().Adjective(),
"ingverb": h.Hacker().Ingverb(),
"noun": h.Hacker().Noun(),
"verb": h.Hacker().Verb(),
}
phrase := h.pick(hackerPrefix + "/phrase")
return mustache(phrase, hackerData)
}