Class: KPeg::FormatParser::MemoEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/kpeg/format_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ans, pos) ⇒ MemoEntry

Returns a new instance of MemoEntry.



207
208
209
210
211
212
# File 'lib/kpeg/format_parser.rb', line 207

def initialize(ans, pos)
  @ans = ans
  @pos = pos
  @uses = 1
  @result = nil
end

Instance Attribute Details

#ansObject (readonly)

Returns the value of attribute ans.



214
215
216
# File 'lib/kpeg/format_parser.rb', line 214

def ans
  @ans
end

#posObject (readonly)

Returns the value of attribute pos.



214
215
216
# File 'lib/kpeg/format_parser.rb', line 214

def pos
  @pos
end

#resultObject (readonly)

Returns the value of attribute result.



214
215
216
# File 'lib/kpeg/format_parser.rb', line 214

def result
  @result
end

#usesObject (readonly)

Returns the value of attribute uses.



214
215
216
# File 'lib/kpeg/format_parser.rb', line 214

def uses
  @uses
end

Instance Method Details

#inc!Object



216
217
218
# File 'lib/kpeg/format_parser.rb', line 216

def inc!
  @uses += 1
end

#move!(ans, pos, result) ⇒ Object



220
221
222
223
224
# File 'lib/kpeg/format_parser.rb', line 220

def move!(ans, pos, result)
  @ans = ans
  @pos = pos
  @result = result
end