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
103 104 105 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 103 def initialize(opts) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
94 95 96 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 94 def opts @opts end |
Instance Method Details
#limit ⇒ Integer
Returns defined depth limit.
108 109 110 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 108 def limit opts.fetch(:limit) end |
#limit=(value) ⇒ Integer
Set depth limit
118 119 120 121 122 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 118 def limit=(value) raise SeregaError, "Depth limit must be an Integer" unless value.is_a?(Integer) opts[:limit] = value end |