Sha256: ba16505441c117cc902428ac6f807bff7f781cfc2e4d3512e317b08bc2b2166e
Contents?: true
Size: 712 Bytes
Versions: 10
Compression:
Stored size: 712 Bytes
Contents
module Finitio class AliasType < Type def initialize(target, name, metadata = nil) unless target.is_a?(Type) raise ArgumentError, "Type expected for target type, got `#{target}`" end if name.nil? raise ArgumentError, "Alias name cannot be nil" end super(name, metadata) @target = target end attr_reader :target def default_name @name end [ :representator, :dress, :undress, :include?, :==, :eql?, :hash, :to_s ].each do |meth| define_method(meth) do |*args, &bl| @target.send(meth, *args, &bl) end end end # class AliasType end # module Finitio
Version data entries
10 entries across 10 versions & 1 rubygems