Sha256: 0b32588cfab858e9c7f76a931b74a83175e4e75f1cc3cbeca66197956b25752f
Contents?: true
Size: 1.16 KB
Versions: 25
Compression:
Stored size: 1.16 KB
Contents
module Schematic module Generator class Types COMPLEX = { :integer => { :complex_type => "Integer", :xsd_type => "xs:integer" }, :float => { :complex_type => "Float", :xsd_type => "xs:float" }, :string => { :complex_type => "String", :xsd_type => "xs:string" }, :text => { :complex_type => "Text", :xsd_type => "xs:string" }, :datetime => { :complex_type => "DateTime", :xsd_type => "xs:dateTime" }, :date => { :complex_type => "Date", :xsd_type => "xs:date" }, :boolean => { :complex_type => "Boolean", :xsd_type => "xs:boolean" }, } def self.xsd(builder) Types::COMPLEX.each do |key, value| complex_type_name = value[:complex_type] xsd_type = value[:xsd_type] builder.xs :complexType, "name" => complex_type_name do |complex_type| complex_type.xs :simpleContent do |simple_content| simple_content.xs :extension, "base" => xsd_type do |extension| extension.xs :attribute, "name" => "type", "type" => "xs:string", "use" => "optional" end end end end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems