Class: Mexico::FileSystem::Head

Inherits:
Object
  • Object
show all
Includes:
ROXML
Defined in:
lib/mexico/file_system/head.rb

Overview

Add class documentation here

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Head

Returns a new instance of Head.



33
34
35
36
37
38
# File 'lib/mexico/file_system/head.rb', line 33

def initialize(args={})
  @sections = []
  ::Mexico::FileSystem::Section::SECTION_KEYS.each do |key|
    @sections << ::Mexico::FileSystem::Section.new(key)
  end
end

Instance Method Details

#[](key) ⇒ Object



40
41
42
# File 'lib/mexico/file_system/head.rb', line 40

def [](key)
  sections.find{|x| x.key == key }
end

#section(key) ⇒ Object



44
45
46
# File 'lib/mexico/file_system/head.rb', line 44

def section(key)
  sections.find{|x| x.key == key }
end