Module: Serega::SeregaConfig::SeregaConfigInstanceMethods
- Included in:
- Serega::SeregaConfig
- Defined in:
- lib/serega/config.rb
Overview
:nocov:
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
- #attribute_keys ⇒ Object
- #check_initiate_params ⇒ Object
- #check_initiate_params=(value) ⇒ Object
- #from_json ⇒ Object
- #from_json=(value) ⇒ Object
-
#initialize(opts = nil) ⇒ Object
Initializes new config instance.
- #initiate_keys ⇒ Object
- #max_cached_map_per_serializer_count ⇒ Object
- #max_cached_map_per_serializer_count=(value) ⇒ Object
- #plugins ⇒ Object
- #serialize_keys ⇒ Object
- #to_json ⇒ Object
- #to_json=(value) ⇒ Object
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
24 25 26 |
# File 'lib/serega/config.rb', line 24 def opts @opts end |
Instance Method Details
#attribute_keys ⇒ Object
44 45 46 |
# File 'lib/serega/config.rb', line 44 def attribute_keys opts.fetch(:attribute_keys) end |
#check_initiate_params ⇒ Object
52 53 54 |
# File 'lib/serega/config.rb', line 52 def check_initiate_params opts.fetch(:check_initiate_params) end |
#check_initiate_params=(value) ⇒ Object
56 57 58 59 |
# File 'lib/serega/config.rb', line 56 def check_initiate_params=(value) raise SeregaError, "Must have boolean value, #{value.inspect} provided" if (value != true) && (value != false) opts[:check_initiate_params] = value end |
#from_json ⇒ Object
78 79 80 |
# File 'lib/serega/config.rb', line 78 def from_json opts.fetch(:from_json) end |
#from_json=(value) ⇒ Object
82 83 84 |
# File 'lib/serega/config.rb', line 82 def from_json=(value) opts[:from_json] = value end |
#initialize(opts = nil) ⇒ Object
Initializes new config instance.
31 32 33 34 |
# File 'lib/serega/config.rb', line 31 def initialize(opts = nil) opts ||= DEFAULTS @opts = SeregaUtils::EnumDeepDup.call(opts) end |
#initiate_keys ⇒ Object
40 41 42 |
# File 'lib/serega/config.rb', line 40 def initiate_keys opts.fetch(:initiate_keys) end |
#max_cached_map_per_serializer_count ⇒ Object
61 62 63 |
# File 'lib/serega/config.rb', line 61 def max_cached_map_per_serializer_count opts.fetch(:max_cached_map_per_serializer_count) end |
#max_cached_map_per_serializer_count=(value) ⇒ Object
65 66 67 68 |
# File 'lib/serega/config.rb', line 65 def max_cached_map_per_serializer_count=(value) raise SeregaError, "Must have Integer value, #{value.inspect} provided" unless value.is_a?(Integer) opts[:max_cached_map_per_serializer_count] = value end |
#plugins ⇒ Object
36 37 38 |
# File 'lib/serega/config.rb', line 36 def plugins opts.fetch(:plugins) end |
#serialize_keys ⇒ Object
48 49 50 |
# File 'lib/serega/config.rb', line 48 def serialize_keys opts.fetch(:serialize_keys) end |
#to_json ⇒ Object
70 71 72 |
# File 'lib/serega/config.rb', line 70 def to_json opts.fetch(:to_json) end |
#to_json=(value) ⇒ Object
74 75 76 |
# File 'lib/serega/config.rb', line 74 def to_json=(value) opts[:to_json] = value end |