Sha256: 1abea745b5fb9ada3d2a4035c97877a0269da68f9c9d43757e3da9e32b8d3fe1
Contents?: true
Size: 844 Bytes
Versions: 60
Compression:
Stored size: 844 Bytes
Contents
require "dry-initializer" # This object holds some data that 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 :main_app, default: proc { view_context.main_app } option :avo, default: proc { view_context.avo } # This is optional because we might instantiate the `Host` first and later hydrate it with a block. option :block, optional: true delegate :authorize, to: Avo::Services::AuthorizationService def handle instance_exec(&block) end end end end
Version data entries
60 entries across 60 versions & 1 rubygems