Class: Ferret::Lexical_Ruleset
- Inherits:
-
Object
- Object
- Ferret::Lexical_Ruleset
- Defined in:
- lib/sql-ferret.rb
Instance Attribute Summary collapse
-
#multichar ⇒ Object
readonly
Returns the value of attribute multichar.
Instance Method Summary collapse
- #id_continuer?(c) ⇒ Boolean
- #id_starter?(c) ⇒ Boolean
-
#initialize(simple: [], intertoken: [], multichar: []) ⇒ Lexical_Ruleset
constructor
A new instance of Lexical_Ruleset.
- #intertoken?(c) ⇒ Boolean
- #simple_particle?(c) ⇒ Boolean
Constructor Details
#initialize(simple: [], intertoken: [], multichar: []) ⇒ Lexical_Ruleset
Returns a new instance of Lexical_Ruleset.
730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 |
# File 'lib/sql-ferret.rb', line 730 def initialize simple: [], intertoken: [], multichar: [] raise 'duck type mismatch' \ unless intertoken.respond_to? :include? raise 'duck type mismatch' \ unless simple.respond_to? :include? raise 'duck type mismatch' \ unless multichar.respond_to? :include? super() @intertoken = intertoken @simple = simple @multichar = multichar return end |
Instance Attribute Details
#multichar ⇒ Object (readonly)
Returns the value of attribute multichar.
728 729 730 |
# File 'lib/sql-ferret.rb', line 728 def multichar @multichar end |
Instance Method Details
#id_continuer?(c) ⇒ Boolean
760 761 762 763 |
# File 'lib/sql-ferret.rb', line 760 def id_continuer? c return [(?A .. ?Z), (?a .. ?z), (?0 .. ?9), [?_]]. any?{|s| s.include? c} end |
#id_starter?(c) ⇒ Boolean
755 756 757 758 |
# File 'lib/sql-ferret.rb', line 755 def id_starter? c return [(?A .. ?Z), (?a .. ?z), [?_]]. any?{|s| s.include? c} end |
#intertoken?(c) ⇒ Boolean
747 748 749 |
# File 'lib/sql-ferret.rb', line 747 def intertoken? c return @intertoken.include? c end |
#simple_particle?(c) ⇒ Boolean
751 752 753 |
# File 'lib/sql-ferret.rb', line 751 def simple_particle? c return @simple.include? c end |