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.



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

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

Instance Attribute Details

#bioObject (readonly)

Returns the value of attribute bio.



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

def bio
  @bio
end

#parsed_rangesObject

Returns the value of attribute parsed_ranges.



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

def parsed_ranges
  @parsed_ranges
end

Instance Method Details

#furthest_parsed_rangeObject



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

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