128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
# File 'lib/brief/model/definition.rb', line 128
def method_missing(meth, *args, &block)
args = args.dup
if inside_content?
if meth.to_sym == :define_section
opts = args.
identifier = args.first
section_mappings[identifier] ||= Brief::Document::Section::Mapping.new(identifier, opts)
section_mapping(identifier).instance_eval(&block) if block
else
content_schema.attributes[meth] = { args: args, block: block }
end
elsif inside_meta?
if args.first.is_a?(Hash)
args.unshift(String)
end
args.unshift(meth)
metadata_schema[meth] = { args: args, block: block }
else
super
end
end
|