Class: Muj::Partials
- Inherits:
-
Object
- Object
- Muj::Partials
- Defined in:
- lib/muj.rb
Instance Method Summary collapse
- #__exists(name) ⇒ Object
- #__read(name) ⇒ Object
-
#initialize(dir) ⇒ Partials
constructor
A new instance of Partials.
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.(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 |