Class: Serega::SeregaPlugins::DepthLimit::DepthLimitConfig
- Inherits:
-
Object
- Object
- Serega::SeregaPlugins::DepthLimit::DepthLimitConfig
- Defined in:
- lib/serega/plugins/depth_limit/depth_limit.rb
Overview
DepthLimit config object
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(opts) ⇒ SeregaPlugins::DepthLimit::DepthLimitConfig
constructor
Initializes DepthLimitConfig object.
-
#limit ⇒ Integer
Defined depth limit.
-
#limit=(value) ⇒ Integer
Set depth limit.
Constructor Details
#initialize(opts) ⇒ SeregaPlugins::DepthLimit::DepthLimitConfig
Initializes DepthLimitConfig object
101 102 103 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 101 def initialize(opts) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
92 93 94 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 92 def opts @opts end |
Instance Method Details
#limit ⇒ Integer
Returns defined depth limit.
106 107 108 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 106 def limit opts.fetch(:limit) end |
#limit=(value) ⇒ Integer
Set depth limit
116 117 118 119 120 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 116 def limit=(value) raise SeregaError, "Depth limit must be an Integer" unless value.is_a?(Integer) opts[:limit] = value end |