Class: Ellipses::Server::MetaFile
- Inherits:
-
Object
- Object
- Ellipses::Server::MetaFile
- Defined in:
- lib/ellipses/server/meta_file.rb
Constant Summary collapse
- FILE =
'src.toml'
- Error =
Class.new(Error)
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(directory) ⇒ MetaFile
constructor
A new instance of MetaFile.
- #read ⇒ Object
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
12 13 14 |
# File 'lib/ellipses/server/meta_file.rb', line 12 def directory @directory end |
Class Method Details
.valid?(directory) ⇒ Boolean
34 35 36 37 38 39 |
# File 'lib/ellipses/server/meta_file.rb', line 34 def valid?(directory) new(directory) true rescue Error false end |
Instance Method Details
#read ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/ellipses/server/meta_file.rb', line 23 def read Meta.new Tomlrb.load_file(@file) rescue StandardError => e raise Error, <<~MSG Error loading meta file: #{@file} #{e..strip} MSG end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/ellipses/server/meta_file.rb', line 19 def to_s @file end |