Class: DirectoryDiff::Transformer::InMemory
- Inherits:
-
Object
- Object
- DirectoryDiff::Transformer::InMemory
- Defined in:
- lib/directory_diff/transformer/in_memory.rb
Instance Attribute Summary collapse
-
#current_directory ⇒ Object
readonly
Returns the value of attribute current_directory.
-
#new_directory ⇒ Object
readonly
Returns the value of attribute new_directory.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#transforms ⇒ Object
readonly
Returns the value of attribute transforms.
-
#transforms_index ⇒ Object
readonly
Returns the value of attribute transforms_index.
Instance Method Summary collapse
-
#initialize(current_directory) ⇒ InMemory
constructor
A new instance of InMemory.
- #into(new_directory, options = {}) ⇒ Object
Constructor Details
#initialize(current_directory) ⇒ InMemory
Returns a new instance of InMemory.
8 9 10 11 12 |
# File 'lib/directory_diff/transformer/in_memory.rb', line 8 def initialize(current_directory) @current_directory = current_directory @transforms = [] @transforms_index = {} end |
Instance Attribute Details
#current_directory ⇒ Object (readonly)
Returns the value of attribute current_directory.
4 5 6 |
# File 'lib/directory_diff/transformer/in_memory.rb', line 4 def current_directory @current_directory end |
#new_directory ⇒ Object (readonly)
Returns the value of attribute new_directory.
4 5 6 |
# File 'lib/directory_diff/transformer/in_memory.rb', line 4 def new_directory @new_directory end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/directory_diff/transformer/in_memory.rb', line 6 def @options end |
#transforms ⇒ Object (readonly)
Returns the value of attribute transforms.
5 6 7 |
# File 'lib/directory_diff/transformer/in_memory.rb', line 5 def transforms @transforms end |
#transforms_index ⇒ Object (readonly)
Returns the value of attribute transforms_index.
5 6 7 |
# File 'lib/directory_diff/transformer/in_memory.rb', line 5 def transforms_index @transforms_index end |
Instance Method Details
#into(new_directory, options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/directory_diff/transformer/in_memory.rb', line 14 def into(new_directory, ={}) raise ArgumentError unless new_directory.respond_to?(:each) @new_directory = new_directory @options = || {} new_employees.each do |email, employee| process_employee(email, employee) end unseen_employees.each do |email, employee| process_employee(email, employee) end transforms end |