Module: ChoronSupport

Defined in:
lib/choron_support.rb,
lib/choron_support/helper.rb,
lib/choron_support/version.rb,
lib/choron_support/as_props.rb,
lib/choron_support/build_form.rb,
lib/choron_support/forms/base.rb,
lib/choron_support/props/base.rb,
lib/choron_support/scope_query.rb,
lib/choron_support/domains/base.rb,
lib/choron_support/queries/base.rb,
lib/choron_support/set_mask_for.rb,
lib/choron_support/domain_delegate.rb

Defined Under Namespace

Modules: AsProps, BuildForm, DomainDelegate, Domains, Forms, Helper, Props, Queries, ScopeQuery, SetMaskFor Classes: Error

Constant Summary collapse

VERSION =
"0.1.11"

Class Method Summary collapse

Class Method Details

.using(*module_names) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/choron_support.rb', line 21

def self.using(*module_names)
  # 何かを使うのであれば共通で利用するもの
  require "active_support/all"
  require_relative "choron_support/version"
  require_relative "choron_support/helper"

  module_names.to_a.each do |module_name|
    case module_name.to_sym
    when :all
      SUPPORT_FILES.each do |_key, file_name|
        require file_name
      end
    else
      file_name = SUPPORT_FILES[module_name.to_sym].to_s
      if file_name.empty?
        raise ArgumentError, "Not support #{module_name}, expected names: #{SUPPORT_FILES.keys} and :all"
      else
        require file_name
      end
    end
  end
end