Module: Akabei::AttrPath

Included in:
Builder, ChrootTree
Defined in:
lib/akabei/attr_path.rb

Instance Method Summary collapse

Instance Method Details

#attr_path_accessor(*attrs) ⇒ Object



15
16
17
18
# File 'lib/akabei/attr_path.rb', line 15

def attr_path_accessor(*attrs)
  attr_reader *attrs
  attr_path_writer *attrs
end

#attr_path_writer(*attrs) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/akabei/attr_path.rb', line 5

def attr_path_writer(*attrs)
  attrs.each do |attr|
    define_method("#{attr}=") do |val|
      unless val.nil?
        instance_variable_set("@#{attr}", Pathname.new(val))
      end
    end
  end
end