Class: ViewPartialFormBuilder::DeprecatedHash
- Inherits:
-
Hash
- Object
- Hash
- ViewPartialFormBuilder::DeprecatedHash
- Defined in:
- lib/view_partial_form_builder/form_builder.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(hash, deprecated_keys: []) ⇒ DeprecatedHash
constructor
A new instance of DeprecatedHash.
Constructor Details
#initialize(hash, deprecated_keys: []) ⇒ DeprecatedHash
Returns a new instance of DeprecatedHash.
331 332 333 334 335 |
# File 'lib/view_partial_form_builder/form_builder.rb', line 331 def initialize(hash, deprecated_keys: []) super() merge!(hash) @deprecated_keys = deprecated_keys end |
Instance Method Details
#[](key) ⇒ Object
337 338 339 340 341 342 343 344 345 |
# File 'lib/view_partial_form_builder/form_builder.rb', line 337 def [](key) if @deprecated_keys.include?(key) ActiveSupport::Deprecation.new("0.2.0", "ViewPartialFormBuilder").warn <<~WARNING Accessing `#{key}` from partials is deprecated. WARNING end super end |