Class: Yes::Core::CommandHandling::MetadataProxy
- Inherits:
-
Object
- Object
- Yes::Core::CommandHandling::MetadataProxy
- Defined in:
- lib/yes/core/command_handling/payload_proxy.rb
Overview
Provides proxy access to command metadata
Instance Method Summary collapse
-
#initialize(raw_metadata) ⇒ MetadataProxy
constructor
A new instance of MetadataProxy.
Constructor Details
#initialize(raw_metadata) ⇒ MetadataProxy
Returns a new instance of MetadataProxy.
93 94 95 |
# File 'lib/yes/core/command_handling/payload_proxy.rb', line 93 def initialize() @raw_metadata = || {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) { ... } ⇒ Object (private)
Handles dynamic method calls to access or set metadata values
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/yes/core/command_handling/payload_proxy.rb', line 121 def method_missing(method_name, *args, &) method_str = method_name.to_s # Handle setter methods (e.g., xyz=) if method_str.end_with?('=') key = method_str.chomp('=').to_sym [key] = args.first # Handle getter methods elsif args.empty? if .key?(method_name) [method_name] elsif .key?(method_str) [method_str] end else super end end |