diff --git a/lib/datagrid.rb b/lib/datagrid.rb index 42bbcce..7a3111b 100644 --- a/lib/datagrid.rb +++ b/lib/datagrid.rb @@ -4,7 +4,6 @@ require "datagrid/configuration" require "datagrid/engine" -# @main README.md module Datagrid # @!visibility private def self.included(base) @@ -19,15 +18,6 @@ def self.included(base) end end - def self.configuration - @configuration ||= Configuration.new - end - - # Configure - def self.configure(&block) - block.call(configuration) - end - class ConfigurationError < StandardError; end class ArgumentError < ::ArgumentError; end class ColumnUnavailableError < StandardError; end diff --git a/lib/datagrid/configuration.rb b/lib/datagrid/configuration.rb index bbdf4bd..5c64e3e 100644 --- a/lib/datagrid/configuration.rb +++ b/lib/datagrid/configuration.rb @@ -1,6 +1,20 @@ # frozen_string_literal: true module Datagrid + # @return [Configuration] current Datagrid configuration + def self.configuration + @configuration ||= Configuration.new + end + + # @yield block to configure + # @yieldparam [Configuration] configuration + # @yieldreturn [void] + # @return [void] configure datagrid + # @see Datagrid::Configuration + def self.configure(&block) + block.call(configuration) + end + # ## Configuration # # Datagrid provides several configuration options. @@ -12,7 +26,7 @@ module Datagrid # # Defines date formats that can be used to parse dates. # # Note: Multiple formats can be specified. The first format is used to format dates as strings, # # while other formats are used only for parsing dates from strings (e.g., if your app supports multiple formats). - # config.date_formats = ["%m/%d/%Y", "%Y-%m-%d"] + # config.date_formats = "%m/%d/%Y", "%Y-%m-%d" # # # Defines timestamp formats that can be used to parse timestamps. # # Note: Multiple formats can be specified. The first format is used to format timestamps as strings, diff --git a/lib/datagrid/filters/base_filter.rb b/lib/datagrid/filters/base_filter.rb index 01c7663..56303f1 100644 --- a/lib/datagrid/filters/base_filter.rb +++ b/lib/datagrid/filters/base_filter.rb @@ -7,7 +7,6 @@ class FilteringError < StandardError end end -# @!visibility private module Datagrid module Filters class BaseFilter diff --git a/lib/datagrid/filters/extended_boolean_filter.rb b/lib/datagrid/filters/extended_boolean_filter.rb index c771fd9..dbd6895 100644 --- a/lib/datagrid/filters/extended_boolean_filter.rb +++ b/lib/datagrid/filters/extended_boolean_filter.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -# @!visibility private module Datagrid module Filters class ExtendedBooleanFilter < Datagrid::Filters::EnumFilter diff --git a/lib/datagrid/generators/scaffold.rb b/lib/datagrid/generators/scaffold.rb index d361bc1..7b38767 100644 --- a/lib/datagrid/generators/scaffold.rb +++ b/lib/datagrid/generators/scaffold.rb @@ -2,7 +2,6 @@ require "rails/generators" -# @!visibility private module Datagrid # @!visibility private module Generators