Class: Gelauto::Var

Inherits:
Object
  • Object
show all
Defined in:
lib/gelauto/var.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, types = TypeSet.new) ⇒ Var

Returns a new instance of Var.



8
9
10
11
# File 'lib/gelauto/var.rb', line 8

def initialize(name, types = TypeSet.new)
  @name = name
  @types = types
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/gelauto/var.rb', line 5

def name
  @name
end

#typesObject

Returns the value of attribute types.



6
7
8
# File 'lib/gelauto/var.rb', line 6

def types
  @types
end

Instance Method Details

#to_sigObject



13
14
15
# File 'lib/gelauto/var.rb', line 13

def to_sig
  "#{name}: #{types.to_sig}"
end