Module: Stupidedi::Reader::Result

Included in:
Failure, Success
Defined in:
lib/stupidedi/reader/result.rb

Constructors collapse

Instance Method Summary collapse

Class Method Details

.failure(reason, remainder, fatal) ⇒ Result::Failure

Returns:

  • (Result::Failure)


46
47
48
# File 'lib/stupidedi/reader/result.rb', line 46

def failure(reason, remainder, fatal)
  Failure.new(reason, remainder, fatal)
end

.success(value, remainder) ⇒ Result::Success

Returns:

  • (Result::Success)


41
42
43
# File 'lib/stupidedi/reader/result.rb', line 41

def success(value, remainder)
  Success.new(value, remainder)
end

Instance Method Details

#columnInteger

Returns:

  • (Integer)


29
30
31
32
33
# File 'lib/stupidedi/reader/result.rb', line 29

def column
  if @remainder.respond_to?(:column)
    @remainder.column
  end
end

#lineInteger

Returns:

  • (Integer)


22
23
24
25
26
# File 'lib/stupidedi/reader/result.rb', line 22

def line
  if @remainder.respond_to?(:line)
    @remainder.line
  end
end

#offsetInteger

Returns:

  • (Integer)


15
16
17
18
19
# File 'lib/stupidedi/reader/result.rb', line 15

def offset
  if @remainder.respond_to?(:offset)
    @remainder.offset
  end
end

#positionPosition

Returns:



8
9
10
11
12
# File 'lib/stupidedi/reader/result.rb', line 8

def position
  if @remainder.respond_to?(:position)
    @remainder.position
  end
end