Class: CaseCheck::CustomTag

Inherits:
Reference
  • Object
show all
Defined in:
lib/case_check/references/custom_tag.rb

Overview

Reference as cf_name (or CF_name)

Class Attribute Summary collapse

Instance Attribute Summary collapse

Attributes inherited from Reference

#line, #source, #text

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Reference

#message, #resolution, #substituted_text, substitutions, #type_name

Constructor Details

#initialize(source, text, line) ⇒ CustomTag

Returns a new instance of CustomTag.



35
36
37
38
39
# File 'lib/case_check/references/custom_tag.rb', line 35

def initialize(source, text, line)
  super
  @expected_path = text[3, text.size] + ".cfm"
  @resolved_to = resolve
end

Class Attribute Details

.directoriesObject



10
11
12
# File 'lib/case_check/references/custom_tag.rb', line 10

def directories
  @directories ||= []
end

Instance Attribute Details

#expected_pathObject (readonly)

Returns the value of attribute expected_path.



5
6
7
# File 'lib/case_check/references/custom_tag.rb', line 5

def expected_path
  @expected_path
end

#resolved_toObject (readonly)

Returns the value of attribute resolved_to.



5
6
7
# File 'lib/case_check/references/custom_tag.rb', line 5

def resolved_to
  @resolved_to
end

Class Method Details

.recursive_directoriesObject



20
21
22
23
24
# File 'lib/case_check/references/custom_tag.rb', line 20

def recursive_directories
  directories + directories.collect do |dir|
    collect_subdirs(dir)
  end.flatten
end

.search(source) ⇒ Object



14
15
16
17
18
# File 'lib/case_check/references/custom_tag.rb', line 14

def search(source)
  source.scan(/<(CF_(\w+))/i) do |match_data, line_number|
    self.new(source, match_data[1], line_number)
  end
end