Sha256: 5afe99c5f939bc3b7c88ac89c80fd28b7367707ea30ec53d3b59852964ef0b28
Contents?: true
Size: 635 Bytes
Versions: 13
Compression:
Stored size: 635 Bytes
Contents
# frozen_string_literal: true module RailsAdmin module Config # Defines a visibility configuration module Hideable # Visibility defaults to true. def self.included(klass) klass.register_instance_option :visible? do !root.try :excluded? end end # Reader whether object is hidden. def hidden? !visible end # Writer to hide object. def hide(&block) visible block ? proc { instance_eval(&block) == false } : false end # Writer to show field. def show(&block) visible block || true end end end end
Version data entries
13 entries across 13 versions & 1 rubygems