Sha256: a0eee29acf58f642f6af9e2dd330a71a888c142d118c50d1ee84efa3d75d4008

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

# Copyright:: (c) Autotelik Media Ltd 2015
# Author ::   Tom Statter
# License::   MIT
#
# Details::  Base class for generators, which provide services to describe a Model in an external format
#
module DataShift

  class GeneratorBase

    include DataShift::Logging

    attr_accessor :configuration

    def initialize; end

    # Prepare to generate with associations but then
    # calls a **derived generate** method i.e abstract to this base class
    #
    # file_name => Filename for generated template
    #
    def generate_with_associations(file_name, klass)

      state = DataShift::Configuration.call.with

      DataShift::Configuration.call.with = :all

      generate(file_name, klass)
    ensure
      DataShift::Configuration.call.with = state

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
datashift-0.40.4 lib/datashift/generators/generator_base.rb
datashift-0.40.3 lib/datashift/generators/generator_base.rb