Class: Yaparc::Succeed

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

Overview

of Module Parsable

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

Attributes included from Parsable

#tree

Instance Method Summary collapse

Methods included from Parsable

#parse

Constructor Details

#initialize(value, remaining = nil) ⇒ Succeed

Returns a new instance of Succeed.



48
49
50
51
52
53
# File 'lib/yaparc.rb', line 48

def initialize(value, remaining = nil)
  @parser = lambda do |input|
    Result::OK.new(:value => value, :input => input)
  end
  @remaining = remaining
end

Instance Attribute Details

#remainingObject (readonly)

Returns the value of attribute remaining.



46
47
48
# File 'lib/yaparc.rb', line 46

def remaining
  @remaining
end