Class: YamlMaster::EmbeddedMethods
- Inherits:
-
Object
- Object
- YamlMaster::EmbeddedMethods
- Defined in:
- lib/yaml_master.rb
Instance Method Summary collapse
-
#initialize(yaml_master) ⇒ EmbeddedMethods
constructor
A new instance of EmbeddedMethods.
- #master_path ⇒ Object
- #read_file_if_exist(path) ⇒ Object
- #user_home ⇒ Object
Constructor Details
#initialize(yaml_master) ⇒ EmbeddedMethods
Returns a new instance of EmbeddedMethods.
78 79 80 |
# File 'lib/yaml_master.rb', line 78 def initialize(yaml_master) @yaml_master = yaml_master end |
Instance Method Details
#master_path ⇒ Object
82 83 84 |
# File 'lib/yaml_master.rb', line 82 def master_path Pathname(@yaml_master.master_path) end |
#read_file_if_exist(path) ⇒ Object
90 91 92 93 |
# File 'lib/yaml_master.rb', line 90 def read_file_if_exist(path) return nil unless File.exist?(path) File.read(path) end |
#user_home ⇒ Object
86 87 88 |
# File 'lib/yaml_master.rb', line 86 def user_home Pathname(ENV["HOME"]) end |