Refactoring: Namespace cleanup. Mixins should be placed the most specific path possible.

This commit is contained in:
Thorsten Eckel 2017-09-15 12:55:49 +02:00
parent e47b366d6a
commit 92930a0e8f
8 changed files with 28 additions and 35 deletions

View file

@ -1,18 +0,0 @@
class Sequencer
module Mixin
module Exchange
module Folder
def self.included(base)
base.uses :ews_connection
end
private
def ews_folder
@ews_folder ||= ::Import::Exchange::Folder.new(ews_connection)
end
end
end
end
end

View file

@ -1,11 +1,9 @@
require 'sequencer/mixin/exchange/folder'
class Sequencer
class Unit
module Exchange
module Folders
class ByIds < Sequencer::Unit::Base
include ::Sequencer::Mixin::Exchange::Folder
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
uses :ews_folder_ids
provides :ews_folders

View file

@ -1,11 +1,9 @@
require 'sequencer/mixin/exchange/folder'
class Sequencer
class Unit
module Exchange
module Folders
class IdPathMap < Sequencer::Unit::Base
include ::Sequencer::Mixin::Exchange::Folder
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
provides :ews_folder_id_path_map

View file

@ -0,0 +1,22 @@
class Sequencer
class Unit
module Exchange
module Folders
module Mixin
module Folder
def self.included(base)
base.uses :ews_connection
end
private
def ews_folder
@ews_folder ||= ::Import::Exchange::Folder.new(ews_connection)
end
end
end
end
end
end
end

View file

@ -1,11 +1,9 @@
require 'sequencer/mixin/exchange/folder'
class Sequencer
class Unit
module Import
module Exchange
class AttributeExamples < Sequencer::Unit::Base
include ::Sequencer::Mixin::Exchange::Folder
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
uses :ews_folder_ids
provides :ews_attributes_examples

View file

@ -1,12 +1,10 @@
require 'sequencer/mixin/exchange/folder'
class Sequencer
class Unit
module Import
module Exchange
module FolderContacts
class FolderIds < Sequencer::Unit::Base
include ::Sequencer::Mixin::Exchange::Folder
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
provides :ews_folder_ids

View file

@ -1,4 +1,3 @@
require 'sequencer/mixin/exchange/folder'
require 'sequencer/mixin/import_job/resource_loop'
class Sequencer
@ -7,7 +6,7 @@ class Sequencer
module Exchange
module FolderContacts
class SubSequence < Sequencer::Unit::Base
include ::Sequencer::Mixin::Exchange::Folder
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
include ::Sequencer::Mixin::ImportJob::ResourceLoop
uses :ews_folder_ids, :import_job

View file

@ -1,12 +1,10 @@
require 'sequencer/mixin/exchange/folder'
class Sequencer
class Unit
module Import
module Exchange
module FolderContacts
class Sum < Sequencer::Unit::Base
include ::Sequencer::Mixin::Exchange::Folder
include ::Sequencer::Unit::Exchange::Folders::Mixin::Folder
uses :ews_folder_ids
provides :statistics_diff