Class: Kanocc::Rhs
- Inherits:
-
Array
- Object
- Array
- Kanocc::Rhs
- Defined in:
- lib/kanocc.rb
Instance Attribute Summary collapse
-
#end_pos ⇒ Object
readonly
Returns the value of attribute end_pos.
-
#start_pos ⇒ Object
readonly
Returns the value of attribute start_pos.
Instance Method Summary collapse
-
#initialize(arr, start_pos, end_pos, input) ⇒ Rhs
constructor
A new instance of Rhs.
- #inspect ⇒ Object
- #text ⇒ Object
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_pos ⇒ Object (readonly)
Returns the value of attribute end_pos.
241 242 243 |
# File 'lib/kanocc.rb', line 241 def end_pos @end_pos end |
#start_pos ⇒ Object (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
#inspect ⇒ Object
251 252 253 |
# File 'lib/kanocc.rb', line 251 def inspect return "#{super.inspect}, #{start_pos.inspect}, #{end_pos.inspect}" end |
#text ⇒ Object
247 248 249 |
# File 'lib/kanocc.rb', line 247 def text @input.slice(start_pos, end_pos - start_pos) end |