Class: AdLint::ProjectTraits
- Inherits:
-
Object
- Object
- AdLint::ProjectTraits
- Includes:
- CompoundPathParser, Validation
- Defined in:
- lib/adlint/traits.rb
Defined Under Namespace
Classes: CodingStyle, TargetFiles
Instance Attribute Summary collapse
-
#coding_style ⇒ Object
readonly
Returns the value of attribute coding_style.
-
#file_encoding ⇒ Object
readonly
Returns the value of attribute file_encoding.
-
#file_search_paths ⇒ Object
readonly
Returns the value of attribute file_search_paths.
-
#initial_header ⇒ Object
readonly
Returns the value of attribute initial_header.
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
-
#project_root ⇒ Object
readonly
Returns the value of attribute project_root.
-
#target_files ⇒ Object
readonly
Returns the value of attribute target_files.
Instance Method Summary collapse
- #entity_name ⇒ Object
- #freeze ⇒ Object
-
#initialize(doc) ⇒ ProjectTraits
constructor
A new instance of ProjectTraits.
Methods included from CompoundPathParser
parse_compound_path_list, parse_compound_path_str
Methods included from Validation
#ensure_dir_presence_of, #ensure_dirs_presence_of, #ensure_exam_packages_presence_of, #ensure_file_presence_of, #ensure_inclusion_of, #ensure_numericality_of, #ensure_presence_of, #ensure_true_or_false_of, #ensure_validity_of, #ensure_with, #errors, included, #valid?, #validators
Constructor Details
#initialize(doc) ⇒ ProjectTraits
Returns a new instance of ProjectTraits.
104 105 106 107 108 109 110 111 112 |
# File 'lib/adlint/traits.rb', line 104 def initialize(doc) @project_name = doc["project_name"] @project_root = Pathname.new(doc["project_root"]) @target_files = TargetFiles.new(doc["target_files"]) @initial_header = doc["initial_header"] @file_search_paths = parse_compound_path_list(doc["file_search_paths"]) @coding_style = CodingStyle.new(doc["coding_style"]) @file_encoding = doc["file_encoding"] end |
Instance Attribute Details
#coding_style ⇒ Object (readonly)
Returns the value of attribute coding_style.
133 134 135 |
# File 'lib/adlint/traits.rb', line 133 def coding_style @coding_style end |
#file_encoding ⇒ Object (readonly)
Returns the value of attribute file_encoding.
136 137 138 |
# File 'lib/adlint/traits.rb', line 136 def file_encoding @file_encoding end |
#file_search_paths ⇒ Object (readonly)
Returns the value of attribute file_search_paths.
130 131 132 |
# File 'lib/adlint/traits.rb', line 130 def file_search_paths @file_search_paths end |
#initial_header ⇒ Object (readonly)
Returns the value of attribute initial_header.
127 128 129 |
# File 'lib/adlint/traits.rb', line 127 def initial_header @initial_header end |
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
118 119 120 |
# File 'lib/adlint/traits.rb', line 118 def project_name @project_name end |
#project_root ⇒ Object (readonly)
Returns the value of attribute project_root.
121 122 123 |
# File 'lib/adlint/traits.rb', line 121 def project_root @project_root end |
#target_files ⇒ Object (readonly)
Returns the value of attribute target_files.
124 125 126 |
# File 'lib/adlint/traits.rb', line 124 def target_files @target_files end |
Instance Method Details
#entity_name ⇒ Object
114 115 116 |
# File 'lib/adlint/traits.rb', line 114 def entity_name "project_traits" end |
#freeze ⇒ Object
200 201 202 203 204 205 206 207 |
# File 'lib/adlint/traits.rb', line 200 def freeze @project_name.freeze @target_files.freeze @file_search_paths.freeze @coding_style.freeze @file_encoding.freeze super end |