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
83 84 85 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 83 def initialize(opts) @opts = opts end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
74 75 76 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 74 def opts @opts end |
Instance Method Details
#limit ⇒ Integer
Returns defined depth limit.
88 89 90 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 88 def limit opts.fetch(:limit) end |
#limit=(value) ⇒ Integer
Set depth limit
98 99 100 101 102 |
# File 'lib/serega/plugins/depth_limit/depth_limit.rb', line 98 def limit=(value) raise SeregaError, "Depth limit must be an Integer" unless value.is_a?(Integer) opts[:limit] = value end |