Module: Qonfig::Imports::Export Private
- Defined in:
- lib/qonfig/imports/export.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
Class Method Details
.export!(exportable_object, exported_config, *exported_setting_keys, mappings: Qonfig::Imports::Mappings::EMPTY_MAPPINGS, raw: Qonfig::Imports::Abstract::DEFAULT_RAW_BEHAVIOR, prefix: Qonfig::Imports::Abstract::EMPTY_PREFIX, accessor: Qonfig::Imports::Abstract::AS_ACCESSOR) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/qonfig/imports/export.rb', line 19 def export!( exportable_object, exported_config, *exported_setting_keys, mappings: Qonfig::Imports::Mappings::EMPTY_MAPPINGS, raw: Qonfig::Imports::Abstract::DEFAULT_RAW_BEHAVIOR, prefix: Qonfig::Imports::Abstract::EMPTY_PREFIX, accessor: Qonfig::Imports::Abstract::AS_ACCESSOR ) exportable_is_a_module = exportable_object.is_a?(Module) rescue false # NOTE: (rescue false (rescue NoMethodError for #is_a?)) # it means that #is_a? is not defined for exportable_object. # it happens only with BasicObject instances. unless exportable_is_a_module # NOTE: # << is a universal way for extrating the singleton class of an object # cuz BasicObject has no #singelton_class method; exportable_object = (class << exportable_object; self; end) end Qonfig::Imports::General.import!( exportable_object, exported_config, *exported_setting_keys, prefix: prefix, raw: raw, mappings: mappings, accessor: accessor ) end |