Module: Finitio::Syntax::SubType
- Includes:
- Node
- Defined in:
- lib/finitio/syntax/type/sub_type.rb
Instance Method Summary
collapse
Methods included from Node
included, #metadata, #resolve_ruby_const, #unique_names!
Instance Method Details
#compile(factory) ⇒ Object
8
9
10
11
12
|
# File 'lib/finitio/syntax/type/sub_type.rb', line 8
def compile(factory)
s = rel_type.compile(factory)
c = constraint_def.compile(factory)
factory.subtype(s, c)
end
|
#to_ast ⇒ Object
14
15
16
|
# File 'lib/finitio/syntax/type/sub_type.rb', line 14
def to_ast
[:sub_type, rel_type.to_ast] + constraint_def.to_ast
end
|