Class: AdLint::ProjectTraits::CodingStyle

Inherits:
Object
  • Object
show all
Includes:
Validation
Defined in:
lib/adlint/traits.rb

Constant Summary collapse

K_AND_R =
"K&R"
ALLMAN =
"Allman"
GNU =
"GNU"

Instance Attribute Summary collapse

Instance Method Summary collapse

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) ⇒ CodingStyle

Returns a new instance of CodingStyle.



173
174
175
176
177
# File 'lib/adlint/traits.rb', line 173

def initialize(doc)
  @indent_style = doc["indent_style"]
  @tab_width    = doc["tab_width"]
  @indent_width = doc["indent_width"]
end

Instance Attribute Details

#indent_styleObject (readonly)

Returns the value of attribute indent_style.



183
184
185
# File 'lib/adlint/traits.rb', line 183

def indent_style
  @indent_style
end

#indent_widthObject (readonly)

Returns the value of attribute indent_width.



189
190
191
# File 'lib/adlint/traits.rb', line 189

def indent_width
  @indent_width
end

#tab_widthObject (readonly)

Returns the value of attribute tab_width.



186
187
188
# File 'lib/adlint/traits.rb', line 186

def tab_width
  @tab_width
end

Instance Method Details

#entity_nameObject



179
180
181
# File 'lib/adlint/traits.rb', line 179

def entity_name
  "project_traits:coding_style"
end

#freezeObject



192
193
194
195
196
197
# File 'lib/adlint/traits.rb', line 192

def freeze
  @indent_style.freeze
  @tab_width.freeze
  @indent_width.freeze
  super
end