Class: ConfigX::FileSource
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(path) ⇒ FileSource
constructor
A new instance of FileSource.
- #load ⇒ Object
Constructor Details
#initialize(path) ⇒ FileSource
Returns a new instance of FileSource.
7 8 9 |
# File 'lib/config_x/file_source.rb', line 7 def initialize(path) @path = path end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/config_x/file_source.rb', line 19 def ==(other) other.is_a?(self.class) && other.path == path end |
#load ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/config_x/file_source.rb', line 11 def load if path && File.exist?(path) YamlSource.new(File.read(path.to_s)).load else {} end end |