The DSL
Requires that the class into which this is included has a
add_attributes!
method
# File lib/cimi/models/schema.rb, line 280 def array(name, opts={}, &block) add_attributes!([name, opts], Array, &block) end
# File lib/cimi/models/schema.rb, line 288 def hash(name) add_attributes!([name, {}], Hash) end
# File lib/cimi/models/schema.rb, line 267 def href(*args) args.each { |arg| struct(arg) { scalar :href } } end
# File lib/cimi/models/schema.rb, line 276 def scalar(*args) add_attributes!(args, Scalar) end
# File lib/cimi/models/schema.rb, line 284 def struct(name, opts={}, &block) add_attributes!([name, opts], Struct, &block) end
# File lib/cimi/models/schema.rb, line 271 def text(*args) args.expand_opts!(:text => :nested) scalar(*args) end