Class: Mexico::FileSystem::Head
- Inherits:
-
Object
- Object
- Mexico::FileSystem::Head
- Includes:
- ROXML
- Defined in:
- lib/mexico/file_system/head.rb
Overview
Add class documentation here
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(args = {}) ⇒ Head
constructor
A new instance of Head.
- #section(key) ⇒ Object
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 |