Class: Tuxedo::CaneViolation::SyntaxViolation

Inherits:
Tuxedo::CaneViolation show all
Defined in:
lib/tuxedo/cane_violation/syntax_violation.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tuxedo::CaneViolation

#violation_type, #violation_type_snake_cased

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



4
5
6
# File 'lib/tuxedo/cane_violation/syntax_violation.rb', line 4

def file_name
  @file_name
end

Class Method Details

.from_cane(cane_violation) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/tuxedo/cane_violation/syntax_violation.rb', line 6

def self.from_cane(cane_violation)
  violation = new

  violation.file_name   = cane_violation.file_name

  violation
end

Instance Method Details

#descriptionObject



14
15
16
# File 'lib/tuxedo/cane_violation/syntax_violation.rb', line 14

def description
  "Files contained invalid syntax"
end

#to_hashObject



18
19
20
21
22
23
24
# File 'lib/tuxedo/cane_violation/syntax_violation.rb', line 18

def to_hash
  {
    :violation_type => violation_type,
    :file_name      => file_name,
    :description    => description,
  }
end