Class: Itinerary::ImportTool
- Inherits:
-
Tool
- Object
- Tool
- Itinerary::ImportTool
show all
- Defined in:
- lib/itinerary/tools/import.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Tool
find_tool, inherited, #initialize, tools
Class Method Details
.name ⇒ Object
4
5
6
|
# File 'lib/itinerary/tools/import.rb', line 4
def self.name
'import'
end
|
Instance Method Details
#parse(args) ⇒ Object
8
9
10
|
# File 'lib/itinerary/tools/import.rb', line 8
def parse(args)
@files = args
end
|
#run ⇒ Object
12
13
14
15
16
17
|
# File 'lib/itinerary/tools/import.rb', line 12
def run
@files.map { |p| Pathname.new(path) }.each do |path|
@itinerary.import_entry(path) if path.file?
end
end
|