Class: Steep::Project::SignatureFile
- Inherits:
-
Object
- Object
- Steep::Project::SignatureFile
- Defined in:
- lib/steep/project/file.rb
Defined Under Namespace
Classes: DeclarationsStatus, ParseErrorStatus
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#content_updated_at ⇒ Object
readonly
Returns the value of attribute content_updated_at.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(path:) ⇒ SignatureFile
constructor
A new instance of SignatureFile.
- #load! ⇒ Object
Constructor Details
#initialize(path:) ⇒ SignatureFile
Returns a new instance of SignatureFile.
134 135 136 137 |
# File 'lib/steep/project/file.rb', line 134 def initialize(path:) @path = path self.content = "" end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
126 127 128 |
# File 'lib/steep/project/file.rb', line 126 def content @content end |
#content_updated_at ⇒ Object (readonly)
Returns the value of attribute content_updated_at.
127 128 129 |
# File 'lib/steep/project/file.rb', line 127 def content_updated_at @content_updated_at end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
125 126 127 |
# File 'lib/steep/project/file.rb', line 125 def path @path end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
129 130 131 |
# File 'lib/steep/project/file.rb', line 129 def status @status end |
Instance Method Details
#load! ⇒ Object
145 146 147 148 149 150 151 |
# File 'lib/steep/project/file.rb', line 145 def load! buffer = Ruby::Signature::Buffer.new(name: path, content: content) decls = Ruby::Signature::Parser.parse_signature(buffer) @status = DeclarationsStatus.new(declarations: decls) rescue Ruby::Signature::Parser::SyntaxError, Ruby::Signature::Parser::SemanticsError => exn @status = ParseErrorStatus.new(error: exn) end |