Class: CaTissue::ExtractCommand
- Inherits:
-
Command
- Object
- Command
- CaTissue::ExtractCommand
- Defined in:
- lib/catissue/extract/command.rb
Overview
ExtractCommand extracts target CaTissue domain class objects whose modification date is within a time interval to a CSV file based on a CSV mapping file.
Instance Method Summary collapse
-
#initialize ⇒ ExtractCommand
constructor
Creates a new ExtractCommand.
-
#run ⇒ Object
Starts an Extractor with the command-line options.
Constructor Details
#initialize ⇒ ExtractCommand
Creates a new ExtractCommand. The delta range is given by the required :since option and optional :before option. The default before value is the current DateTime. These are used to build a Delta which is passed to CaRuby::Command#initialize as the :ids option. The :log option specifies a log file. Other supported options are described in CaTissue::Extractor#initialize.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/catissue/extract/command.rb', line 15 def initialize # prep the options since = opts.delete(:since) raise ArgumentError.new("Missing required beginning of date selection range option") unless since before = opts.delete(:before) || DateTime.now # the data acquirer opts[:ids] = Delta.new(@target, since, before) # make the command super(opts) end |