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)


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

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

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

Returns:

  • (Result::Success)


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

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

Instance Method Details

#columnInteger

Returns:



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

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

#lineInteger

Returns:



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

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

#offsetInteger

Returns:



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

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

#positionPosition

Returns:



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

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