Class: MessageDir::Path

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

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Path

Returns a new instance of Path.



101
102
103
# File 'lib/message_dir.rb', line 101

def initialize(root)
  @root = root
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



105
106
107
108
109
110
111
# File 'lib/message_dir.rb', line 105

def method_missing(method, *args, &block)
  super
rescue NoMethodError => e
  if [ :new, :cur, :tmp ].include?(method)
    return File.join(@root, method.to_s)
  end
end