Module: Renc
- Extended by:
- Configuration
- Defined in:
- lib/renc.rb,
lib/renc/version.rb,
lib/renc/configuration.rb
Overview
recursive encode for Hash and Array.
Defined Under Namespace
Modules: Configuration
Constant Summary collapse
- TARGET_CLASS =
for include #renc method
[String, Array, Hash, Struct].freeze
- VERSION =
'2.2.2'.freeze
- ERR_MESSAGE_ENCODING =
'argument `encoding` is not a Encoding Class'.freeze
- ERR_MESSAGE_OPTIONS =
'argument `options` is not a Hash Class'.freeze
Constants included from Configuration
Configuration::DEFAULT_ENCODING, Configuration::DEFAULT_OPTIONS
Instance Method Summary collapse
-
#renc(encoding = Renc.default_encoding, options = Renc.default_options) ⇒ Object
recursive encode for Hash and Array.
Methods included from Configuration
default_encoding, default_encoding=, default_options, default_options=
Instance Method Details
#renc(encoding = Renc.default_encoding, options = Renc.default_options) ⇒ Object
recursive encode for Hash and Array.
43 44 45 46 47 48 49 50 51 |
# File 'lib/renc.rb', line 43 def renc(encoding = Renc.default_encoding, = Renc.) raise TypeError, ERR_MESSAGE_ENCODING unless encoding.is_a?(Encoding) raise TypeError, ERR_MESSAGE_OPTIONS unless .is_a?(Hash) @encoding = encoding @options = _renc(self) end |