Class: Contentful::Importer::Configuration
- Inherits:
-
Object
- Object
- Contentful::Importer::Configuration
- Defined in:
- lib/contentful/importer/configuration.rb
Instance Attribute Summary collapse
-
#assets_dir ⇒ Object
readonly
Returns the value of attribute assets_dir.
-
#collections_dir ⇒ Object
readonly
Returns the value of attribute collections_dir.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#data_dir ⇒ Object
readonly
Returns the value of attribute data_dir.
-
#entries_dir ⇒ Object
readonly
Returns the value of attribute entries_dir.
-
#imported_entries ⇒ Object
readonly
Returns the value of attribute imported_entries.
-
#log_files_dir ⇒ Object
readonly
Returns the value of attribute log_files_dir.
-
#published_assets ⇒ Object
readonly
Returns the value of attribute published_assets.
-
#published_entries ⇒ Object
readonly
Returns the value of attribute published_entries.
-
#space_id ⇒ Object
readonly
Returns the value of attribute space_id.
-
#threads_dir ⇒ Object
readonly
Returns the value of attribute threads_dir.
Instance Method Summary collapse
-
#initialize(settings) ⇒ Configuration
constructor
A new instance of Configuration.
- #validate_required_parameters ⇒ Object
Constructor Details
#initialize(settings) ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/contentful/importer/configuration.rb', line 18 def initialize(settings) @config = settings validate_required_parameters @data_dir = settings['data_dir'] @collections_dir = "#{data_dir}/collections" @entries_dir = "#{data_dir}/entries" @assets_dir = "#{data_dir}/assets" @log_files_dir = "#{data_dir}/logs" @threads_dir = "#{data_dir}/threads" @imported_entries = [] @published_entries = [] @published_assets = [] @space_id = settings['space_id'] end |
Instance Attribute Details
#assets_dir ⇒ Object (readonly)
Returns the value of attribute assets_dir.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def assets_dir @assets_dir end |
#collections_dir ⇒ Object (readonly)
Returns the value of attribute collections_dir.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def collections_dir @collections_dir end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def config @config end |
#data_dir ⇒ Object (readonly)
Returns the value of attribute data_dir.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def data_dir @data_dir end |
#entries_dir ⇒ Object (readonly)
Returns the value of attribute entries_dir.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def entries_dir @entries_dir end |
#imported_entries ⇒ Object (readonly)
Returns the value of attribute imported_entries.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def imported_entries @imported_entries end |
#log_files_dir ⇒ Object (readonly)
Returns the value of attribute log_files_dir.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def log_files_dir @log_files_dir end |
#published_assets ⇒ Object (readonly)
Returns the value of attribute published_assets.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def published_assets @published_assets end |
#published_entries ⇒ Object (readonly)
Returns the value of attribute published_entries.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def published_entries @published_entries end |
#space_id ⇒ Object (readonly)
Returns the value of attribute space_id.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def space_id @space_id end |
#threads_dir ⇒ Object (readonly)
Returns the value of attribute threads_dir.
5 6 7 |
# File 'lib/contentful/importer/configuration.rb', line 5 def threads_dir @threads_dir end |
Instance Method Details
#validate_required_parameters ⇒ Object
33 34 35 |
# File 'lib/contentful/importer/configuration.rb', line 33 def validate_required_parameters fail ArgumentError, 'Set PATH to data_dir. Folder where all data will be stored. View README' if config['data_dir'].nil? end |