Class: ArchSpec::SourceFile

Inherits:
Object
  • Object
show all
Defined in:
lib/archspec/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root:, path:, expected_constant:, parse_errors:, suppressions:) ⇒ SourceFile

Returns a new instance of SourceFile.



20
21
22
23
24
25
26
# File 'lib/archspec/model.rb', line 20

def initialize(root:, path:, expected_constant:, parse_errors:, suppressions:)
  @path = path
  @relative_path = Pathname(path).relative_path_from(Pathname(root)).to_s
  @expected_constant = expected_constant
  @parse_errors = parse_errors
  @suppressions = suppressions
end

Instance Attribute Details

#expected_constantObject (readonly)

Returns the value of attribute expected_constant.



18
19
20
# File 'lib/archspec/model.rb', line 18

def expected_constant
  @expected_constant
end

#parse_errorsObject (readonly)

Returns the value of attribute parse_errors.



18
19
20
# File 'lib/archspec/model.rb', line 18

def parse_errors
  @parse_errors
end

#pathObject (readonly)

Returns the value of attribute path.



18
19
20
# File 'lib/archspec/model.rb', line 18

def path
  @path
end

#relative_pathObject (readonly)

Returns the value of attribute relative_path.



18
19
20
# File 'lib/archspec/model.rb', line 18

def relative_path
  @relative_path
end

#suppressionsObject (readonly)

Returns the value of attribute suppressions.



18
19
20
# File 'lib/archspec/model.rb', line 18

def suppressions
  @suppressions
end