Class | Nukumi2::ConfigParser::Topic |
In: |
lib/nukumi2/config-parser.rb
|
Parent: | Object |
topic | [R] | |
topics | [R] | |
topics | [R] |
# File lib/nukumi2/config-parser.rb, line 93 93: def self.attr_set(a) 94: define_method(a) { |*arg| 95: if arg.size == 1 96: @fields[a] = arg.first 97: end 98: @fields[a] 99: } 100: end
# File lib/nukumi2/config-parser.rb, line 65 65: def initialize(parent, name) 66: @parent = parent 67: @topic = TopicContext.new(self) 68: @topics = {} 69: @name = name 70: 71: @fields = {} 72: 73: if @name.empty? 74: @parent.define "/", self 75: else 76: @parent.define(@name, self) 77: end 78: end
# File lib/nukumi2/config-parser.rb, line 113 113: def all(&block) 114: t = Topic.new(self, "**") 115: t.instance_eval(&block) 116: end
# File lib/nukumi2/config-parser.rb, line 108 108: def any(&block) 109: t = Topic.new(self, "*") 110: t.instance_eval(&block) 111: end
# File lib/nukumi2/config-parser.rb, line 85 85: def define(name, obj) 86: @parent.define(@name + "/" + name, obj) 87: end