Class: Uinit::Type::Generic

Inherits:
Base
  • Object
show all
Defined in:
lib/uinit/type/generic.rb

Direct Known Subclasses

ArrayOf, SetOf

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, [], from, from?, #is!, #to_s, #trace!, #type_error!

Methods included from Operators

#&, #|

Constructor Details

#initialize(type) ⇒ Generic

Returns a new instance of Generic.



6
7
8
9
10
# File 'lib/uinit/type/generic.rb', line 6

def initialize(type)
  super()

  @type = Type.from(type)
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



12
13
14
# File 'lib/uinit/type/generic.rb', line 12

def type
  @type
end

Instance Method Details

#inspectObject



14
15
16
# File 'lib/uinit/type/generic.rb', line 14

def inspect
  "#{super}[#{type.inspect}]"
end