Class: Vagabond::Layout
- Inherits:
-
Object
- Object
- Vagabond::Layout
- Defined in:
- lib/vagabond/layout.rb
Instance Method Summary collapse
- #[](k) ⇒ Object
-
#initialize(base_dir) ⇒ Layout
constructor
A new instance of Layout.
Constructor Details
#initialize(base_dir) ⇒ Layout
Returns a new instance of Layout.
4 5 6 7 8 9 |
# File 'lib/vagabond/layout.rb', line 4 def initialize(base_dir) unless(File.exists?(path = File.join(base_dir, 'spec/Layout'))) raise 'Spec layout file does not exist' end @l = Mash.new(self.instance_eval(IO.read(path), path, 1)) end |
Instance Method Details
#[](k) ⇒ Object
11 12 13 |
# File 'lib/vagabond/layout.rb', line 11 def [](k) @l[k] end |