Class: Vagabond::Layout

Inherits:
Object
  • Object
show all
Defined in:
lib/vagabond/layout.rb

Instance Method Summary collapse

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