Class: Yaparc::Item

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

Overview

class ItemParser

Constant Summary

Constants included from Parsable

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

Instance Attribute Summary

Attributes included from Parsable

#tree

Instance Method Summary collapse

Methods included from Parsable

#eval, included, #parse

Constructor Details

#initializeItem

Returns a new instance of Item.



91
92
93
94
95
96
97
98
99
# File 'lib/yaparc.rb', line 91

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