Module: FromFile

Defined in:
lib/madvertise/from_file.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#from_file(path) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/madvertise/from_file.rb', line 13

def from_file(path)
  if File.exists?(path) && File.readable?(path)
    self.instance_eval(IO.read(path), path, 1)
  else
    raise IOError, "Cannot open or read #{path}!"
  end
end