Skip to content

Commit 0b9d4a1

Browse files
committed
Make internal constants private
1 parent 06db496 commit 0b9d4a1

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

lib/multi_json/adapters/json_common.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class JsonCommon < Adapter
1111
object_nl: "\n",
1212
array_nl: "\n"
1313
}.freeze
14+
private_constant :PRETTY_STATE_PROTOTYPE
1415

1516
def load(string, options = {})
1617
string = string.dup.force_encoding(::Encoding::ASCII_8BIT) if string.respond_to?(:force_encoding)

lib/multi_json/adapters/oj.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Oj < Adapter
1717
# (at least for now).
1818
class ParseError < ::SyntaxError
1919
WRAPPED_CLASSES = %w[Oj::ParseError JSON::ParserError].to_set.freeze
20+
private_constant :WRAPPED_CLASSES
2021

2122
def self.===(exception)
2223
case exception
@@ -36,6 +37,7 @@ def load(string, options = {})
3637
OJ_VERSION = ::Oj::VERSION
3738
OJ_V2 = OJ_VERSION.start_with?("2.")
3839
OJ_V3 = OJ_VERSION.start_with?("3.")
40+
private_constant :OJ_VERSION, :OJ_V2, :OJ_V3
3941

4042
if OJ_V3
4143
PRETTY_STATE_PROTOTYPE = {
@@ -46,6 +48,7 @@ def load(string, options = {})
4648
array_nl: "\n",
4749
ascii_only: false
4850
}.freeze
51+
private_constant :PRETTY_STATE_PROTOTYPE
4952
end
5053

5154
def dump(object, options = {})

lib/multi_json/convertible_hash_keys.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module MultiJson
22
module ConvertibleHashKeys
33
SIMPLE_OBJECT_CLASSES = [String, Numeric, TrueClass, FalseClass, NilClass].freeze
4+
private_constant :SIMPLE_OBJECT_CLASSES
45

56
private
67

0 commit comments

Comments
 (0)