Class: AdLint::MessageTraits
- Inherits:
-
Object
- Object
- AdLint::MessageTraits
- Includes:
- CompoundPathParser, Validation
- Defined in:
- lib/adlint/traits.rb
Instance Attribute Summary collapse
-
#change_list ⇒ Object
readonly
Returns the value of attribute change_list.
-
#exclusion ⇒ Object
readonly
Returns the value of attribute exclusion.
-
#inclusion ⇒ Object
readonly
Returns the value of attribute inclusion.
-
#individual_suppression ⇒ Object
readonly
Returns the value of attribute individual_suppression.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
Instance Method Summary collapse
- #entity_name ⇒ Object
- #freeze ⇒ Object
-
#initialize(doc) ⇒ MessageTraits
constructor
A new instance of MessageTraits.
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) ⇒ MessageTraits
Returns a new instance of MessageTraits.
496 497 498 499 500 501 502 503 504 505 506 |
# File 'lib/adlint/traits.rb', line 496 def initialize(doc) @language = doc["language"] @individual_suppression = doc["individual_suppression"] @exclusion = Exclusion.new(doc["exclusion"]) @inclusion = Inclusion.new(doc["inclusion"]) @change_list = (doc["change_list"] || []).each_with_object({}) { |(name, cont), hash| hash[MessageId.new(cont["package"], name.to_sym)] = cont } end |
Instance Attribute Details
#change_list ⇒ Object (readonly)
Returns the value of attribute change_list.
524 525 526 |
# File 'lib/adlint/traits.rb', line 524 def change_list @change_list end |
#exclusion ⇒ Object (readonly)
Returns the value of attribute exclusion.
518 519 520 |
# File 'lib/adlint/traits.rb', line 518 def exclusion @exclusion end |
#inclusion ⇒ Object (readonly)
Returns the value of attribute inclusion.
521 522 523 |
# File 'lib/adlint/traits.rb', line 521 def inclusion @inclusion end |
#individual_suppression ⇒ Object (readonly)
Returns the value of attribute individual_suppression.
515 516 517 |
# File 'lib/adlint/traits.rb', line 515 def individual_suppression @individual_suppression end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
512 513 514 |
# File 'lib/adlint/traits.rb', line 512 def language @language end |
Instance Method Details
#entity_name ⇒ Object
508 509 510 |
# File 'lib/adlint/traits.rb', line 508 def entity_name "message_traits" end |
#freeze ⇒ Object
586 587 588 589 590 591 592 593 |
# File 'lib/adlint/traits.rb', line 586 def freeze @language.freeze @individual_suppression.freeze @exclusion.freeze @inclusion.freeze @change_list.freeze super end |