(directive IDirective)
| 13 | } |
| 14 | |
| 15 | func NewLuaBlock(directive IDirective) (*LuaBlock, error) { |
| 16 | if block := directive.GetBlock(); block != nil { |
| 17 | lb := &LuaBlock{ |
| 18 | Directives: []IDirective{}, |
| 19 | Name: directive.GetName(), |
| 20 | LuaCode: block.GetCodeBlock(), |
| 21 | } |
| 22 | |
| 23 | lb.Directives = append(lb.Directives, block.GetDirectives()...) |
| 24 | return lb, nil |
| 25 | } |
| 26 | return nil, fmt.Errorf("%s must have a block", directive.GetName()) |
| 27 | } |
| 28 | |
| 29 | func (lb *LuaBlock) GetName() string { |
| 30 | return lb.Name |
nothing calls this directly
no test coverage detected