Class: RedisImporter::RedisImporter
- Inherits:
-
Object
- Object
- RedisImporter::RedisImporter
- Includes:
- GemConfigurator
- Defined in:
- lib/redis_importer/redis_importer.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
Instance Method Summary collapse
- #import ⇒ Object
-
#initialize ⇒ RedisImporter
constructor
A new instance of RedisImporter.
Constructor Details
#initialize ⇒ RedisImporter
Returns a new instance of RedisImporter.
8 9 10 11 12 13 14 |
# File 'lib/redis_importer/redis_importer.rb', line 8 def initialize configure self.collection = Object::const_get("#{@settings[:storage_method].camelcase}Collection").new() self.files = self.collection.files self.commands = [] end |
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
6 7 8 |
# File 'lib/redis_importer/redis_importer.rb', line 6 def collection @collection end |
#commands ⇒ Object
Returns the value of attribute commands.
5 6 7 |
# File 'lib/redis_importer/redis_importer.rb', line 5 def commands @commands end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/redis_importer/redis_importer.rb', line 5 def errors @errors end |
#files ⇒ Object
Returns the value of attribute files.
5 6 7 |
# File 'lib/redis_importer/redis_importer.rb', line 5 def files @files end |
Instance Method Details
#import ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/redis_importer/redis_importer.rb', line 16 def import files.each do |file| begin convert_to_redis_commands(file) if class_exists?(file.to_class_name.to_sym) rescue NameError add_errors("#{file.name} is not matched by a class #{file.to_class_name} in the system.") end end pipeline end |