Class: Mode::Connector::Dispatcher
- Inherits:
-
Object
- Object
- Mode::Connector::Dispatcher
- Defined in:
- lib/mode/connector/dispatcher.rb
Overview
Rename to Dispatcher
Constant Summary collapse
- Commands =
Mode::Connector::Commands
Instance Attribute Summary collapse
-
#data_sources ⇒ Object
readonly
Returns the value of attribute data_sources.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource, data_sources) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
- #perform! ⇒ Object
Constructor Details
#initialize(resource, data_sources) ⇒ Dispatcher
Returns a new instance of Dispatcher.
9 10 11 12 |
# File 'lib/mode/connector/dispatcher.rb', line 9 def initialize(resource, data_sources) @resource = resource @data_sources = data_sources end |
Instance Attribute Details
#data_sources ⇒ Object (readonly)
Returns the value of attribute data_sources.
5 6 7 |
# File 'lib/mode/connector/dispatcher.rb', line 5 def data_sources @data_sources end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/mode/connector/dispatcher.rb', line 4 def resource @resource end |
Instance Method Details
#perform! ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/mode/connector/dispatcher.rb', line 14 def perform! case resource.command['name'] when 'select:table:metadata' Commands::SelectTableMetadata.new(resource, data_sources).perform! when 'select:report_run:dataset' Commands::SelectReportRunDataset.new(resource, data_sources).perform! end rescue => err Mode::Logger.instance.error( self.class.name, err., err.backtrace) end |