Sha256: 35404633a52d9fdabc065fc1e2a1374e8acb639a6fbc8765712237b85132c205

Contents?: true

Size: 522 Bytes

Versions: 8

Compression:

Stored size: 522 Bytes

Contents

require 'golden_fleece/context'

module GoldenFleece
  module Model
    module Context
      def self.included(base)
        base.extend ClassMethods

        base.instance_eval do
          @fleece_context = GoldenFleece::Context.new(self)
        end
      end

      module ClassMethods
        attr_reader :fleece_context

        def fleece(&block)
          fleece_context.instance_eval(&block)
          fleece_context.run_setup_callbacks unless fleece_context.has_run_setup
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
golden_fleece-1.0.1 lib/golden_fleece/model/context.rb
golden_fleece-1.0.0 lib/golden_fleece/model/context.rb
golden_fleece-0.1.5 lib/golden_fleece/model/context.rb
golden_fleece-0.1.4 lib/golden_fleece/model/context.rb
golden_fleece-0.1.3 lib/golden_fleece/model/context.rb
golden_fleece-0.1.2 lib/golden_fleece/model/context.rb
golden_fleece-0.1.1 lib/golden_fleece/model/context.rb
golden_fleece-0.1.0 lib/golden_fleece/model/context.rb