Class: Finitio::AliasType
Constant Summary
Constants included from Metadata
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #default_name ⇒ Object
-
#initialize(target, name, metadata = nil) ⇒ AliasType
constructor
A new instance of AliasType.
Methods inherited from Type
#==, #anonymous?, #dress, #include?, #name, #name=, #named?, #to_s
Methods included from Metadata
#metadata, #metadata=, #metadata?
Constructor Details
#initialize(target, name, metadata = nil) ⇒ AliasType
Returns a new instance of AliasType.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/finitio/type/alias_type.rb', line 4 def initialize(target, name, = 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, ) @target = target end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
15 16 17 |
# File 'lib/finitio/type/alias_type.rb', line 15 def target @target end |
Instance Method Details
#default_name ⇒ Object
17 18 19 |
# File 'lib/finitio/type/alias_type.rb', line 17 def default_name @name end |