Class: Orbacle::GenericType

Inherits:
Object
  • Object
show all
Defined in:
lib/orbacle/generic_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, parameters) ⇒ GenericType

Returns a new instance of GenericType.



5
6
7
8
# File 'lib/orbacle/generic_type.rb', line 5

def initialize(name, parameters)
  @name = name
  @parameters = parameters
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/orbacle/generic_type.rb', line 10

def name
  @name
end

#parametersObject (readonly)

Returns the value of attribute parameters.



10
11
12
# File 'lib/orbacle/generic_type.rb', line 10

def parameters
  @parameters
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



12
13
14
15
16
# File 'lib/orbacle/generic_type.rb', line 12

def ==(other)
  self.class == other.class &&
    self.name == other.name &&
    self.parameters == other.parameters
end

#bottom?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/orbacle/generic_type.rb', line 31

def bottom?
  false
end

#each_possible_type {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



27
28
29
# File 'lib/orbacle/generic_type.rb', line 27

def each_possible_type
  yield self
end

#hashObject



18
19
20
21
22
23
24
# File 'lib/orbacle/generic_type.rb', line 18

def hash
  [
    self.class,
    self.name,
    self.parameters,
  ].hash ^ BIG_VALUE
end