Class: Cymometer::Helper::CounterConfig
- Inherits:
-
Object
- Object
- Cymometer::Helper::CounterConfig
- Defined in:
- lib/cymometer/helper.rb
Instance Attribute Summary collapse
-
#key(val = nil, &block) ⇒ Object
Returns the value of attribute key.
-
#limit(val) ⇒ Object
DSL methods.
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace(ns) ⇒ Object
Returns the value of attribute namespace.
-
#redis(client) ⇒ Object
Returns the value of attribute redis.
-
#window(val) ⇒ Object
Returns the value of attribute window.
Instance Method Summary collapse
-
#initialize(name) ⇒ CounterConfig
constructor
A new instance of CounterConfig.
-
#to_h ⇒ Object
standard:enable Lint/DuplicateMethods standard:enable Style/TrivialAccessors.
Constructor Details
#initialize(name) ⇒ CounterConfig
Returns a new instance of CounterConfig.
127 128 129 |
# File 'lib/cymometer/helper.rb', line 127 def initialize(name) @name = name.to_s end |
Instance Attribute Details
#key(val = nil, &block) ⇒ Object
Returns the value of attribute key.
125 126 127 |
# File 'lib/cymometer/helper.rb', line 125 def key @key end |
#limit(val) ⇒ Object
DSL methods
135 136 137 |
# File 'lib/cymometer/helper.rb', line 135 def limit @limit end |
#name ⇒ Object
Returns the value of attribute name.
125 126 127 |
# File 'lib/cymometer/helper.rb', line 125 def name @name end |
#namespace(ns) ⇒ Object
Returns the value of attribute namespace.
125 126 127 |
# File 'lib/cymometer/helper.rb', line 125 def namespace @namespace end |
#redis(client) ⇒ Object
Returns the value of attribute redis.
125 126 127 |
# File 'lib/cymometer/helper.rb', line 125 def redis @redis end |
#window(val) ⇒ Object
Returns the value of attribute window.
125 126 127 |
# File 'lib/cymometer/helper.rb', line 125 def window @window end |
Instance Method Details
#to_h ⇒ Object
standard:enable Lint/DuplicateMethods standard:enable Style/TrivialAccessors
158 159 160 161 162 163 164 165 166 167 |
# File 'lib/cymometer/helper.rb', line 158 def to_h { name: @name, limit: @limit, window: @window, key: @key, redis: @redis, namespace: @namespace } end |