Sha256: df541c12cc7e5bffdd9ea63a2ef74d161ead55ed44dffc3132493d3e910b199b

Contents?: true

Size: 551 Bytes

Versions: 20

Compression:

Stored size: 551 Bytes

Contents

require "dry-initializer"

# This object holds some data tha is usually needed to compute blocks around the app.
module Avo
  module Hosts
    class BaseHost
      extend Dry::Initializer

      option :context, default: proc { Avo::App.context }
      option :params, default: proc { Avo::App.params }
      option :view_context, default: proc { Avo::App.view_context }
      option :current_user, default: proc { Avo::App.current_user }
      option :block, optional: true

      def handle
        instance_exec(&block)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
avo-2.6.0 lib/avo/hosts/base_host.rb
avo-2.5.2.pre.7 lib/avo/hosts/base_host.rb
avo-2.5.2.pre.6 lib/avo/hosts/base_host.rb
avo-2.5.2.pre.5 lib/avo/hosts/base_host.rb
avo-2.5.2.pre.4 lib/avo/hosts/base_host.rb
avo-2.5.2.pre.3 lib/avo/hosts/base_host.rb
avo-2.5.2.pre.2 lib/avo/hosts/base_host.rb
avo-2.5.2.pre.1 lib/avo/hosts/base_host.rb
avo-2.5.1 lib/avo/hosts/base_host.rb
avo-2.5.0 lib/avo/hosts/base_host.rb
avo-2.4.1 lib/avo/hosts/base_host.rb
avo-2.4.0 lib/avo/hosts/base_host.rb
avo-2.3.1.pre.6 lib/avo/hosts/base_host.rb
avo-2.3.1.pre.5 lib/avo/hosts/base_host.rb
avo-2.3.1.pre.4 lib/avo/hosts/base_host.rb
avo-2.3.1.pre.3 lib/avo/hosts/base_host.rb
avo-2.3.1.pre.2 lib/avo/hosts/base_host.rb
avo-2.3.1.pre.1 lib/avo/hosts/base_host.rb
avo-2.3.0 lib/avo/hosts/base_host.rb
avo-2.2.2 lib/avo/hosts/base_host.rb