class WillPaginate::Deprecation::Hash
Public Class Methods
Source
# File lib/will_paginate/deprecation.rb, line 23 def initialize(values = {}) super() update values @deprecated = {} end
Calls superclass method
Public Instance Methods
Source
# File lib/will_paginate/deprecation.rb, line 29 def []=(key, value) check_deprecated(key, value) super end
Calls superclass method
Source
# File lib/will_paginate/deprecation.rb, line 34 def deprecate_key(*keys, &block) message = block_given? ? block : keys.pop Array(keys).each { |key| @deprecated[key] = message } end
Source
# File lib/will_paginate/deprecation.rb, line 39 def merge(another) to_hash.update(another) end
Source
# File lib/will_paginate/deprecation.rb, line 43 def to_hash ::Hash.new.update(self) end
Private Instance Methods
Source
# File lib/will_paginate/deprecation.rb, line 49 def check_deprecated(key, value) if msg = @deprecated[key] and (!msg.respond_to?(:call) or (msg = msg.call(key, value))) WillPaginate::Deprecation.warn(msg) end end