Class: Cymometer::Helper::CounterConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cymometer/helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

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_hObject

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