Sha256: 2baaa2c704cdad17cc5f69df251a7e7f3ebaeb2bb6a7b080ceab16939c79ee66

Contents?: true

Size: 781 Bytes

Versions: 22

Compression:

Stored size: 781 Bytes

Contents

class Gon
  class Global < Gon
    class << self

      def all_variables
        @global_vars || {}
      end

      def clear
        @global_vars = {}
      end

      def inspect
        'Gon::Global'
      end

      def rabl(*args)
        data, options = Gon::Rabl.handler(args, true)
        store_builder_data 'rabl', data, options
      end

      def jbuilder(*args)
        ensure_template_handler_is_defined
        data, options = Gon::Jbuilder.handler(args, true)
        store_builder_data 'jbuilder', data, options
      end

      private

      def get_variable(name)
        @global_vars ||= {}
        @global_vars[name]
      end

      def set_variable(name, value)
        @global_vars ||= {}
        @global_vars[name] = value
      end

    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
gon-6.4.0 lib/gon/global.rb
gon-6.3.2 lib/gon/global.rb
gon-6.3.1 lib/gon/global.rb
gon-6.2.1 lib/gon/global.rb
gon-6.2.0 lib/gon/global.rb
gon-6.1.0 lib/gon/global.rb
gon-6.0.1 lib/gon/global.rb
gon-6.0.0 lib/gon/global.rb
gon-5.2.3 lib/gon/global.rb
gon-5.2.2 lib/gon/global.rb
gon-5.2.1 lib/gon/global.rb
gon-5.2.0 lib/gon/global.rb
gon-5.1.2 lib/gon/global.rb
gon-5.1.1 lib/gon/global.rb
gon-5.1.0 lib/gon/global.rb
gon-5.0.4 lib/gon/global.rb
gon-5.0.3 lib/gon/global.rb
gon-5.0.2 lib/gon/global.rb
gon-5.0.1 lib/gon/global.rb
gon-5.0.0 lib/gon/global.rb