Class: Lrama::Grammar::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/lrama/grammar/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, tag:) ⇒ Type



8
9
10
11
# File 'lib/lrama/grammar/type.rb', line 8

def initialize(id:, tag:)
  @id = id
  @tag = tag
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/lrama/grammar/type.rb', line 6

def id
  @id
end

#tagObject (readonly)

Returns the value of attribute tag.



6
7
8
# File 'lib/lrama/grammar/type.rb', line 6

def tag
  @tag
end

Instance Method Details

#==(other) ⇒ Object



13
14
15
16
17
# File 'lib/lrama/grammar/type.rb', line 13

def ==(other)
  self.class == other.class &&
  self.id == other.id &&
  self.tag == other.tag
end