Class: FunctionDefinitionPattern

Inherits:
Pattern show all
Defined in:
ext/generate.rb

Instance Attribute Summary

Attributes inherited from Pattern

#search_files

Instance Method Summary collapse

Constructor Details

#initialize(return_type, name, *search_files) ⇒ FunctionDefinitionPattern

Returns a new instance of FunctionDefinitionPattern.



28
29
30
31
32
# File 'ext/generate.rb', line 28

def initialize(return_type, name, *search_files)
  @return_type = return_type
  @name = name
  super(*search_files)
end

Instance Method Details

#dump(captured, out) ⇒ Object



42
43
44
45
# File 'ext/generate.rb', line 42

def dump(captured, out)
  out.puts @return_type
  super(captured, out)
end

#matches_end(str) ⇒ Object



38
39
40
# File 'ext/generate.rb', line 38

def matches_end(str)
  return str =~ /^\}/
end

#matches_start(str) ⇒ Object



34
35
36
# File 'ext/generate.rb', line 34

def matches_start(str)
  return str =~ /^#{@name}/
end