Class: Yaparc::Succeed

Inherits:
Object
  • Object
show all
Includes:
Parsable
Defined in:
lib/yaparc/succeed.rb

Constant Summary

Constants included from Parsable

Parsable::IS_ALPHANUM, Parsable::IS_CR, Parsable::IS_DIGIT, Parsable::IS_LOWER, Parsable::IS_SPACE, Parsable::IS_WHITESPACE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Parsable

#parse

Constructor Details

#initialize(value, remaining = nil) ⇒ Succeed

Returns a new instance of Succeed.



9
10
11
12
# File 'lib/yaparc/succeed.rb', line 9

def initialize(value, remaining = nil)
  @parser = ->(input) { OK.new(value:, input:) }
  @remaining = remaining
end

Instance Attribute Details

#remainingObject (readonly)

Returns the value of attribute remaining.



7
8
9
# File 'lib/yaparc/succeed.rb', line 7

def remaining
  @remaining
end