Class: Yaparc::Item
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
Attributes included from Parsable
Instance Method Summary collapse
-
#initialize ⇒ Item
constructor
A new instance of Item.
Methods included from Parsable
Constructor Details
#initialize ⇒ Item
Returns a new instance of Item.
69 70 71 72 73 74 75 76 77 |
# File 'lib/yaparc.rb', line 69 def initialize @parser = lambda do |input| if input.nil? or input.empty? Result::Fail.new(:input => input) else Result::OK.new(:value => input[0..0],:input => input[1..input.length]) end end end |