Class: App
- Inherits:
-
Object
- Object
- App
- Defined in:
- lib/osm2mongo.rb
Constant Summary collapse
- VERSION =
'0.0.1'
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments, stdin) ⇒ App
constructor
A new instance of App.
-
#run ⇒ Object
Parse options, check arguments, then process the command.
Constructor Details
#initialize(arguments, stdin) ⇒ App
Returns a new instance of App.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/osm2mongo.rb', line 52 def initialize(arguments, stdin) @arguments = arguments @stdin = stdin # Set defaults = OpenStruct.new .verbose = false .quiet = false # TO DO - add additional defaults end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
50 51 52 |
# File 'lib/osm2mongo.rb', line 50 def end |
Instance Method Details
#run ⇒ Object
Parse options, check arguments, then process the command
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/osm2mongo.rb', line 64 def run if && arguments_valid? puts "Start at #{DateTime.now}\n\n" if .verbose if .verbose # [Optional] process_arguments process_command puts "\nFinished at #{DateTime.now}" if .verbose else output_usage end end |