# File lib/algebrick/dsl.rb, line 33 def initialize(new_type, &block) @new_type = Type! new_type, ProductVariant, ParametrizedType instance_exec @new_type, &block @new_type.kind if @new_type.is_a? ProductVariant end
# File lib/algebrick/dsl.rb, line 66 def all_field_readers @new_type.add_all_field_method_readers self end
# File lib/algebrick/dsl.rb, line 59 def field_readers(*names) @new_type.add_field_method_readers *names self end
# File lib/algebrick/dsl.rb, line 39 def fields(*fields) @new_type.set_fields fields.first.is_a?(Hash) ? fields.first : fields self end
# File lib/algebrick/dsl.rb, line 44 def fields!(*fields) fields(*fields) all_readers end
# File lib/algebrick/dsl.rb, line 49 def final! @new_type.final! self end
# File lib/algebrick/dsl.rb, line 54 def variants(*variants) @new_type.set_variants *variants self end