Sha256: 04618fec56e793b24ce9523a215952aa8a1435d2173fd974867a126607d3afb5

Contents?: true

Size: 522 Bytes

Versions: 25

Compression:

Stored size: 522 Bytes

Contents

module Elastics
  module Templates

    extend self
    attr_accessor :contexts
    @contexts = []

    def self.included(context)
      context.class_eval do
        Elastics::Templates.contexts |= [context]
        @elastics ||= ClassProxy::Base.new(context)
        @elastics.extend(ClassProxy::Templates).init
        def self.elastics; @elastics end
        def self.template_methods; elastics.templates.keys end
        eval "extend module #{context}::ElasticsTemplateMethods; self end"
      end
    end

  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
elastics-client-1.3.3 lib/elastics/templates.rb
elastics-client-1.3.2 lib/elastics/templates.rb
elastics-client-1.3.1 lib/elastics/templates.rb
elastics-client-1.3.0 lib/elastics/templates.rb
elastics-client-1.2.1 lib/elastics/templates.rb
elastics-client-1.2.0 lib/elastics/templates.rb
elastics-client-1.1.11 lib/elastics/templates.rb
elastics-client-1.1.10 lib/elastics/templates.rb
elastics-client-1.1.9 lib/elastics/templates.rb
elastics-client-1.1.8 lib/elastics/templates.rb
elastics-client-1.1.7 lib/elastics/templates.rb
elastics-client-1.1.6 lib/elastics/templates.rb
elastics-client-1.1.5 lib/elastics/templates.rb
elastics-client-1.1.4 lib/elastics/templates.rb
elastics-client-1.1.3 lib/elastics/templates.rb
elastics-client-1.1.2 lib/elastics/templates.rb
elastics-client-1.1.1 lib/elastics/templates.rb
elastics-client-1.1.0 lib/elastics/templates.rb
elastics-client-1.0.10 lib/elastics/templates.rb
elastics-client-1.0.9 lib/elastics/templates.rb