Class: Muj::Partials

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

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Partials

Returns a new instance of Partials.



22
23
24
# File 'lib/muj.rb', line 22

def initialize(dir)
  @dir = File.expand_path(dir)
end

Instance Method Details

#__exists(name) ⇒ Object



26
27
28
29
# File 'lib/muj.rb', line 26

def __exists(name)
  fname = name.gsub('>','/')
  File.exists?("#{@dir}/#{fname}.muj")
end

#__read(name) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/muj.rb', line 31

def __read(name)
  fname = name.gsub('>','/')
  f = File.open("#{@dir}/#{fname}.muj")
  r = f.read.chomp
  f.close
  r
end