Class: AsciiDataTools::Controller::AbstractController
- Inherits:
-
Object
- Object
- AsciiDataTools::Controller::AbstractController
- Defined in:
- lib/ascii-data-tools/controller.rb
Direct Known Subclasses
CatController, EditController, NormalisationController, QDiffController
Instance Method Summary collapse
-
#initialize(configuration_or_command_line_arguments) ⇒ AbstractController
constructor
A new instance of AbstractController.
- #run ⇒ Object
- #type_determiner ⇒ Object
Constructor Details
#initialize(configuration_or_command_line_arguments) ⇒ AbstractController
Returns a new instance of AbstractController.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ascii-data-tools/controller.rb', line 8 def initialize(configuration_or_command_line_arguments) case configuration_or_command_line_arguments when Hash then @configuration = Configuration.new([], defaults.merge(configuration_or_command_line_arguments)) when Array then @configuration = Configuration.new(configuration_or_command_line_arguments, defaults) when Configuration then @configuration = configuration_or_command_line_arguments end @configuration.error_info_with_usage unless @configuration.valid? end |
Instance Method Details
#run ⇒ Object
24 25 26 |
# File 'lib/ascii-data-tools/controller.rb', line 24 def run raise "should be implemented!" end |
#type_determiner ⇒ Object
20 21 22 |
# File 'lib/ascii-data-tools/controller.rb', line 20 def type_determiner @type_determiner ||= RecordType::TypeDeterminer.new(@configuration.record_types) end |