Class: Kanocc::Rhs

Inherits:
Array
  • Object
show all
Defined in:
lib/kanocc.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arr, start_pos, end_pos, input) ⇒ Rhs

Returns a new instance of Rhs.



242
243
244
245
# File 'lib/kanocc.rb', line 242

def initialize(arr, start_pos, end_pos, input)
  @start_pos, @end_pos, @input = start_pos, end_pos, input
  super(arr)
end

Instance Attribute Details

#end_posObject (readonly)

Returns the value of attribute end_pos.



241
242
243
# File 'lib/kanocc.rb', line 241

def end_pos
  @end_pos
end

#start_posObject (readonly)

Returns the value of attribute start_pos.



241
242
243
# File 'lib/kanocc.rb', line 241

def start_pos
  @start_pos
end

Instance Method Details

#inspectObject



251
252
253
# File 'lib/kanocc.rb', line 251

def inspect
  return "#{super.inspect}, #{start_pos.inspect}, #{end_pos.inspect}"
end

#textObject



247
248
249
# File 'lib/kanocc.rb', line 247

def text
  @input.slice(start_pos, end_pos - start_pos)
end