Class: OracleSqlParser::Grammar::ReservedWordGenerator::MatchKeyword

Inherits:
Array
  • Object
show all
Defined in:
lib/oracle-sql-parser/grammar/reserved_word_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule_name) ⇒ MatchKeyword

Returns a new instance of MatchKeyword.



49
50
51
# File 'lib/oracle-sql-parser/grammar/reserved_word_generator.rb', line 49

def initialize(rule_name)
  @rule_name = rule_name
end

Instance Attribute Details

#rule_nameObject (readonly)

Returns the value of attribute rule_name.



48
49
50
# File 'lib/oracle-sql-parser/grammar/reserved_word_generator.rb', line 48

def rule_name
  @rule_name
end

Instance Method Details

#to_sObject



53
54
55
56
57
58
59
# File 'lib/oracle-sql-parser/grammar/reserved_word_generator.rb', line 53

def to_s
  content = []
  content << "    rule #{rule_name}"
  content << "      [a-zA-Z0-9_]+ ![a-zA-Z0-9] &{|w| #{self.to_a.to_s}.include? w.first.text_value.upcase}"
  content << "    end"
  content.join("\n")
end