Class: MultiGit::Config::Schema::Root

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

Instance Method Summary collapse

Constructor Details

#initialize(hash = Hash.new(Hash.new(Hash.new(NULL)))) ⇒ Root

Returns a new instance of Root.



61
62
63
# File 'lib/multi_git/config/schema.rb', line 61

def initialize(hash = Hash.new(Hash.new(Hash.new(NULL))) )
  @hash = hash
end

Instance Method Details

#schemaObject



65
66
67
# File 'lib/multi_git/config/schema.rb', line 65

def schema
  @hash
end

#section(key, &block) ⇒ Object



69
70
71
72
73
# File 'lib/multi_git/config/schema.rb', line 69

def section(key, &block)
  sec = Section.new(@hash.fetch(key){ @hash[key] = Hash.new(Hash.new(NULL))})
  sec.instance_eval(&block) if block_given?
  return sec
end