Class: WillPaginate::Deprecation::Hash

Inherits:
Hash
  • Object
show all
Defined in:
lib/will_paginate/deprecation.rb

Instance Method Summary (collapse)

Constructor Details

- (Hash) initialize(values = {})



23
24
25
26
27
# File 'lib/will_paginate/deprecation.rb', line 23

def initialize(values = {})
  super()
  update values
  @deprecated = {}
end

Instance Method Details

- (Object) []=(key, value)



29
30
31
32
# File 'lib/will_paginate/deprecation.rb', line 29

def []=(key, value)
  check_deprecated(key, value)
  super
end

- (Object) deprecate_key(*keys)



34
35
36
37
# File 'lib/will_paginate/deprecation.rb', line 34

def deprecate_key(*keys)
  message = block_given? ? Proc.new : keys.pop
  Array(keys).each { |key| @deprecated[key] = message }
end

- (Object) merge(another)



39
40
41
# File 'lib/will_paginate/deprecation.rb', line 39

def merge(another)
  to_hash.update(another)
end

- (Object) to_hash



43
44
45
# File 'lib/will_paginate/deprecation.rb', line 43

def to_hash
  ::Hash.new.update(self)
end