class LegacyPattern

LegacyPattern allows for a hash to be treated as a Pattern It implements the minimum required to be sucessfully generated by the grammar

Public Class Methods

new(hash) click to toggle source
Calls superclass method PatternBase::new
# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 10
def initialize(hash)
    super("placeholder")
    @hash = hash.transform_keys(&:to_sym)
end

Public Instance Methods

__deep_clone__() click to toggle source

(see PatternBase#deep_clone)

# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 58
def __deep_clone__
    self.class.new(@hash)
end
evaluate(*_ignored) click to toggle source

LegacyPattern cannot be evaluated

# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 16
def evaluate(*_ignored)
    raise "LegacyPattern cannot be used as a part of a Pattern"
end
insert!(_pattern) click to toggle source

LegacyPattern cannot be chained

# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 21
def insert!(_pattern)
    raise "LegacyPattern cannot be used as a part of a Pattern"
end
map!(*) click to toggle source

(see PatternBase#map!)

# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 44
def map!(*)
    self
end
run_tests() click to toggle source

(see PatternBase#run_tests)

# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 37
def run_tests
    true
end
start_pattern() click to toggle source

(see PatternBase#start_pattern)

# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 51
def start_pattern
    ""
end
to_tag() click to toggle source

(see PatternBase#to_tag)

@return [Hash] The hash it was constructed with

# File lib/ruby_grammar_builder/pattern_variations/legacy_pattern.rb, line 30
def to_tag
    @hash
end