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.



5
6
7
8
9
10
# File 'lib/vagabond/layout.rb', line 5

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



12
13
14
# File 'lib/vagabond/layout.rb', line 12

def [](k)
  @l[k]
end