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-1.15.1 app/models/effective/resources/model.rb
effective_resources-1.15.0 app/models/effective/resources/model.rb
effective_resources-1.14.0 app/models/effective/resources/model.rb
effective_resources-1.13.0 app/models/effective/resources/model.rb
effective_resources-1.12.4 app/models/effective/resources/model.rb
effective_resources-1.12.3 app/models/effective/resources/model.rb
effective_resources-1.12.2 app/models/effective/resources/model.rb
effective_resources-1.12.1 app/models/effective/resources/model.rb
effective_resources-1.12.0 app/models/effective/resources/model.rb
effective_resources-1.11.0 app/models/effective/resources/model.rb
effective_resources-1.10.1 app/models/effective/resources/model.rb
effective_resources-1.10.0 app/models/effective/resources/model.rb
effective_resources-1.9.19 app/models/effective/resources/model.rb
effective_resources-1.9.18 app/models/effective/resources/model.rb
effective_resources-1.9.17 app/models/effective/resources/model.rb
effective_resources-1.9.16 app/models/effective/resources/model.rb
effective_resources-1.9.15 app/models/effective/resources/model.rb
effective_resources-1.9.14 app/models/effective/resources/model.rb
effective_resources-1.9.13 app/models/effective/resources/model.rb
effective_resources-1.9.12 app/models/effective/resources/model.rb