Class: Ajimi::Config

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

Constant Summary collapse

CONFIG_KEYWORDS =
%i(
  source
  target
  check_root_path
  pruned_paths
  ignored_paths
  ignored_contents
  pending_paths
  pending_contents
)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



6
7
8
# File 'lib/ajimi/config.rb', line 6

def initialize
  @config = {}
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



4
5
6
# File 'lib/ajimi/config.rb', line 4

def config
  @config
end

Class Method Details

.load(path) ⇒ Object



10
11
12
13
14
# File 'lib/ajimi/config.rb', line 10

def self.load(path)
  Ajimi::Config.new.tap do |obj|
    obj.load_file(path)
  end.config
end

Instance Method Details

#load_file(path) ⇒ Object



16
17
18
# File 'lib/ajimi/config.rb', line 16

def load_file(path)
  instance_eval(File.read(path), path) if path
end