Class: Dustcart::Resource::Input::FileBase

Inherits:
Base
  • Object
show all
Defined in:
lib/dustcart/input/file_base.rb

Overview

base class for file system input

Direct Known Subclasses

Directory, File

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #dump_dir

Instance Method Summary collapse

Methods inherited from Base

define_attribute, inherited, #method_missing, #respond_to_missing?, #run

Constructor Details

#initialize(to_dir, from, &block) ⇒ FileBase

Returns a new instance of FileBase.



8
9
10
11
# File 'lib/dustcart/input/file_base.rb', line 8

def initialize(to_dir, from, &block)
  super(to_dir, &block)
  @from = from
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dustcart::Resource::Base

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



6
7
8
# File 'lib/dustcart/input/file_base.rb', line 6

def from
  @from
end

Instance Method Details

#precheckObject



13
14
15
16
17
18
19
# File 'lib/dustcart/input/file_base.rb', line 13

def precheck
  super

  raise "    target(\#{from}) does not exists\n  EOS\nend\n".unindent unless Object::File.exists?(from)