Sha256: 723addf6b86017fbebc8ff21a6cc0947615162394ef473c70046e2128d1b53eb

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

require 'singleton'

module Smooth
  class Configuration
    include Singleton

    cattr_accessor :query_class,
                   :command_class,
                   :serializer_class,
                   :enable_events

    @@query_class       = Smooth::Query
    @@command_class     = Smooth::Command
    @@serializer_class  = defined?(ApplicationSerializer) ? ApplicationSerializer : Smooth::Serializer
    @@enable_events     = true

    def enable_event_tracking?
      !!@@enable_events
    end

    def self.method_missing meth, *args, &block
      instance.send(meth, *args, &block)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smooth-2.0.1 lib/smooth/configuration.rb