Class: WillPaginate::Deprecation::Hash
- Inherits:
-
Hash
- Object
- Hash
- WillPaginate::Deprecation::Hash
- Defined in:
- lib/will_paginate/deprecation.rb
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
- #deprecate_key(*keys, &block) ⇒ Object
-
#initialize(values = {}) ⇒ Hash
constructor
A new instance of Hash.
- #merge(another) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(values = {}) ⇒ Hash
Returns a new instance of Hash.
23 24 25 26 27 |
# File 'lib/will_paginate/deprecation.rb', line 23 def initialize(values = {}) super() update values @deprecated = {} end |
Instance Method Details
#[]=(key, value) ⇒ Object
29 30 31 32 |
# File 'lib/will_paginate/deprecation.rb', line 29 def []=(key, value) check_deprecated(key, value) super end |
#deprecate_key(*keys, &block) ⇒ Object
34 35 36 37 |
# File 'lib/will_paginate/deprecation.rb', line 34 def deprecate_key(*keys, &block) = block_given? ? block : keys.pop Array(keys).each { |key| @deprecated[key] = } end |
#merge(another) ⇒ Object
39 40 41 |
# File 'lib/will_paginate/deprecation.rb', line 39 def merge(another) to_hash.update(another) end |
#to_hash ⇒ Object
43 44 45 |
# File 'lib/will_paginate/deprecation.rb', line 43 def to_hash ::Hash.new.update(self) end |