Class: IsccLib::Result
- Inherits:
-
Hash
- Object
- Hash
- IsccLib::Result
- Defined in:
- lib/iscc_lib.rb
Overview
Base result class providing both Hash-style and attribute-style access.
Direct Known Subclasses
AudioCodeResult, DataCodeResult, IdCodeResult, ImageCodeResult, InstanceCodeResult, IsccCodeResult, MetaCodeResult, MixedCodeResult, SumCodeResult, TextCodeResult, VideoCodeResult
Instance Method Summary collapse
-
#method_missing(name, *args) ⇒ Object
Allow attribute-style access for hash keys (e.g., result.iscc).
-
#respond_to_missing?(name, include_private = false) ⇒ Boolean
Support respond_to? for dynamic attribute access.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
Allow attribute-style access for hash keys (e.g., result.iscc).
23 24 25 26 27 28 |
# File 'lib/iscc_lib.rb', line 23 def method_missing(name, *args) key = name.to_s return self[key] if key?(key) super end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
Support respond_to? for dynamic attribute access.
31 32 33 |
# File 'lib/iscc_lib.rb', line 31 def respond_to_missing?(name, include_private = false) key?(name.to_s) || super end |