Module: Renc::Configuration
- Included in:
- Renc
- Defined in:
- lib/renc/configuration.rb
Overview
namespace
Constant Summary collapse
- DEFAULT_ENCODING =
this gem’s default configured encoding
Encoding.default_external
- DEFAULT_OPTIONS =
this gem’s default options for String#encode
{ undef: :replace }.freeze
Instance Method Summary collapse
-
#default_encoding ⇒ Encoding
return @default_encoding.
-
#default_encoding=(encoding) ⇒ Object
configure default encoding.
-
#default_options ⇒ Encoding
return @default_options.
-
#default_options=(options) ⇒ Object
configure default options.
Instance Method Details
#default_encoding ⇒ Encoding
return @default_encoding
18 19 20 |
# File 'lib/renc/configuration.rb', line 18 def default_encoding @default_encoding ||= DEFAULT_ENCODING end |
#default_encoding=(encoding) ⇒ Object
configure default encoding
27 28 29 30 31 |
# File 'lib/renc/configuration.rb', line 27 def default_encoding=(encoding) raise TypeError, ERR_MESSAGE_ENCODING unless encoding.is_a?(Encoding) @default_encoding = encoding end |
#default_options ⇒ Encoding
return @default_options
36 37 38 |
# File 'lib/renc/configuration.rb', line 36 def @default_options ||= DEFAULT_OPTIONS end |
#default_options=(options) ⇒ Object
configure default options
45 46 47 48 49 |
# File 'lib/renc/configuration.rb', line 45 def () raise TypeError, ERR_MESSAGE_OPTIONS unless .is_a?(Hash) @default_options = end |