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)

49
50
51
# File 'lib/stupidedi/reader/result.rb', line 49

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

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

Returns:

  • (Result::Success)

44
45
46
# File 'lib/stupidedi/reader/result.rb', line 44

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

Instance Method Details

#columnInteger

Returns:

  • (Integer)

32
33
34
35
36
# File 'lib/stupidedi/reader/result.rb', line 32

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

#lineInteger

Returns:

  • (Integer)

25
26
27
28
29
# File 'lib/stupidedi/reader/result.rb', line 25

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

#offsetInteger

Returns:

  • (Integer)

18
19
20
21
22
# File 'lib/stupidedi/reader/result.rb', line 18

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

#positionPosition

Returns:


11
12
13
14
15
# File 'lib/stupidedi/reader/result.rb', line 11

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