Sha256: d91fe8bfe2b39bee908a38856bb88b3a3687df60f06020358a3a6164f99701ee

Contents?: true

Size: 613 Bytes

Versions: 62

Compression:

Stored size: 613 Bytes

Contents

# frozen_string_literal: true

module Effective
  module Resources
    module Model
      attr_accessor :model  # As defined by effective_resource do block in a model file

      def _initialize_model(&block)
        @model = (model || ModelReader.new)
        @model.read(&block)

        # If effective_developer is in live mode, this will cause it to refresh the class
        ActiveSupport.run_load_hooks(:effective_resource, self)
      end

      def model
        @model || (klass.effective_resource.model if klass.respond_to?(:effective_resource) && klass.effective_resource)
      end

    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
effective_resources-2.2.12 app/models/effective/resources/model.rb
effective_resources-2.2.11 app/models/effective/resources/model.rb
effective_resources-2.2.10 app/models/effective/resources/model.rb
effective_resources-2.2.9 app/models/effective/resources/model.rb
effective_resources-2.2.8 app/models/effective/resources/model.rb
effective_resources-2.2.7 app/models/effective/resources/model.rb
effective_resources-2.2.6 app/models/effective/resources/model.rb
effective_resources-2.2.5 app/models/effective/resources/model.rb
effective_resources-2.2.4 app/models/effective/resources/model.rb
effective_resources-2.2.3 app/models/effective/resources/model.rb
effective_resources-2.2.2 app/models/effective/resources/model.rb
effective_resources-2.2.1 app/models/effective/resources/model.rb
effective_resources-2.2.0 app/models/effective/resources/model.rb
effective_resources-2.1.4 app/models/effective/resources/model.rb
effective_resources-2.1.3 app/models/effective/resources/model.rb
effective_resources-2.1.2 app/models/effective/resources/model.rb
effective_resources-2.1.1 app/models/effective/resources/model.rb
effective_resources-2.1.0 app/models/effective/resources/model.rb
effective_resources-2.0.4 app/models/effective/resources/model.rb
effective_resources-2.0.3 app/models/effective/resources/model.rb