Module: Schematic::Serializers::Xsd

Defined in:
lib/schematic/serializers/xsd.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



7
8
9
10
# File 'lib/schematic/serializers/xsd.rb', line 7

def self.extended(klass)
  raise ClassMissingXmlSerializer unless klass.ancestors.include?(ActiveModel::Serializers::Xml)
  raise ClassMissingAttributes unless klass.instance_methods.include?(:attributes)
end

Instance Method Details

#schematic(&block) ⇒ Object



12
13
14
# File 'lib/schematic/serializers/xsd.rb', line 12

def schematic(&block)
  schematic_sandbox.run(&block)
end

#schematic_sandboxObject



16
17
18
# File 'lib/schematic/serializers/xsd.rb', line 16

def schematic_sandbox
  @schematic_sandbox ||= Schematic::Generator::Sandbox.new(self)
end

#to_xsd(options = {}) ⇒ Object



20
21
22
# File 'lib/schematic/serializers/xsd.rb', line 20

def to_xsd(options = {})
  schematic_sandbox.to_xsd(options)
end