lib/steep/project/signature_file.rb in steep-0.39.0 vs lib/steep/project/signature_file.rb in steep-0.40.0
- old
+ new
@@ -3,12 +3,10 @@
class SignatureFile
attr_reader :path
attr_reader :content
attr_reader :content_updated_at
- attr_reader :status
-
ParseErrorStatus = Struct.new(:error, :timestamp, keyword_init: true)
DeclarationsStatus = Struct.new(:declarations, :timestamp, keyword_init: true)
def initialize(path:)
@path = path
@@ -17,9 +15,17 @@
def content=(content)
@content_updated_at = Time.now
@content = content
@status = nil
+ end
+
+ def status
+ unless @status
+ @status = DeclarationsStatus.new(declarations: [], timestamp: Time.now)
+ end
+
+ @status
end
def load!
buffer = RBS::Buffer.new(name: path, content: content)
decls = RBS::Parser.parse_signature(buffer)