class Migrator

Attributes

config[R]
converter[R]
exporter[R]

Public Class Methods

new(settings) click to toggle source
# File lib/migrator.rb, line 10
def initialize(settings)
  @config = Contentful::Configuration.new(settings)
  @exporter = Contentful::Exporter::Drupal::Export.new(config)
  @converter = Contentful::Converter::ContentfulModelToJson.new(config)
end

Public Instance Methods

run(action) click to toggle source
# File lib/migrator.rb, line 16
def run(action)
  case action.to_s
    when '--extract-to-json'
      exporter.save_data_as_json
    when '--convert-content-model-to-json'
      converter.convert_to_import_form
    when '--create-contentful-model-from-json'
      converter.create_content_type_json
    else
      fail ArgumentError, 'You have entered incorrect action! View README'
  end
end