Class: Parsby::Context

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ Context

Returns a new instance of Context.



586
587
588
589
# File 'lib/parsby.rb', line 586

def initialize(io)
  @bio = BackedIO.new io
  @failures = []
end

Instance Attribute Details

#bioObject (readonly)

Returns the value of attribute bio.



583
584
585
# File 'lib/parsby.rb', line 583

def bio
  @bio
end

#parsed_rangesObject

Returns the value of attribute parsed_ranges.



584
585
586
# File 'lib/parsby.rb', line 584

def parsed_ranges
  @parsed_ranges
end

Instance Method Details

#furthest_parsed_rangeObject



591
592
593
# File 'lib/parsby.rb', line 591

def furthest_parsed_range
  parsed_ranges.flatten.max_by(&:start)
end