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.



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

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.



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

def expected_constant
  @expected_constant
end

#parse_errorsObject (readonly)

Returns the value of attribute parse_errors.



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

def parse_errors
  @parse_errors
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#relative_pathObject (readonly)

Returns the value of attribute relative_path.



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

def relative_path
  @relative_path
end

#suppressionsObject (readonly)

Returns the value of attribute suppressions.



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

def suppressions
  @suppressions
end