Class: Orbacle::NominalType

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ NominalType

Returns a new instance of NominalType.



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

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/orbacle/nominal_type.rb', line 9

def name
  @name
end

Instance Method Details

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



11
12
13
14
# File 'lib/orbacle/nominal_type.rb', line 11

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

#bottom?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/orbacle/nominal_type.rb', line 28

def bottom?
  false
end

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

Yields:

  • (_self)

Yield Parameters:



24
25
26
# File 'lib/orbacle/nominal_type.rb', line 24

def each_possible_type
  yield self
end

#hashObject



16
17
18
19
20
21
# File 'lib/orbacle/nominal_type.rb', line 16

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