Class: YamlMaster::EmbeddedMethods

Inherits:
Object
  • Object
show all
Defined in:
lib/yaml_master.rb

Instance Method Summary collapse

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_pathObject



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_homeObject



86
87
88
# File 'lib/yaml_master.rb', line 86

def user_home
  Pathname(ENV["HOME"])
end