Class: SmartHash::Loose
- Inherits:
-
SmartHash
- Object
- Hash
- SmartHash
- SmartHash::Loose
- Defined in:
- lib/smart_hash/loose.rb
Overview
Non-strict SmartHash
person = SmartHash::Loose[]
is equivalent to:
person = SmartHash[]
person.strict = false
Constant Summary
Constant Summary
Constants inherited from SmartHash
ATTR_REGEXP, FORBIDDEN_ATTRS, VERSION
Instance Attribute Summary
Attributes inherited from SmartHash
#declared_attrs, #protected_attrs, #strict
Class Method Summary (collapse)
-
+ (Object) [](*args)
See SmartHash::[].
Instance Method Summary (collapse)
-
- (Loose) initialize(*args)
constructor
See SmartHash#initialize.
Methods inherited from SmartHash
#declare, #protect, #undeclare, #unprotect
Constructor Details
- (Loose) initialize(*args)
See SmartHash#initialize.
12 13 14 15 |
# File 'lib/smart_hash/loose.rb', line 12 def initialize(*args) super @strict = false end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SmartHash
Class Method Details
+ (Object) [](*args)
See SmartHash::[].
18 19 20 21 22 |
# File 'lib/smart_hash/loose.rb', line 18 def self.[](*args) super.tap do |_| _.strict = false end end |