Module: JsonRpcObjects::V11::WD::Extensions
- Included in:
- Error, ProcedureCall, ProcedureReturn
- Defined in:
- lib/json-rpc-objects/v11/wd/extensions.rb
Overview
Module for extension support in JSON-RPC 1.1 WD.
Instance Attribute Summary collapse
-
#extensions ⇒ Hash
Holds extensions.
Instance Method Summary collapse
-
#[](name) ⇒ Object
Handles array access as access for extensions too.
-
#[]=(name, value) ⇒ Object
Handles array set to extensions.
-
#method_missing(name, *args) ⇒ Object
Handles method missing call for extensions.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
Handles method missing call for extensions.
45 46 47 48 49 50 51 |
# File 'lib/json-rpc-objects/v11/wd/extensions.rb', line 45 def method_missing(name, *args) if name.to_s[-1].chr == ?= self[name.to_s[0..-2]] = args.first else self[name] end end |
Instance Attribute Details
#extensions ⇒ Hash
Holds extensions.
34 35 36 |
# File 'lib/json-rpc-objects/v11/wd/extensions.rb', line 34 def extensions @extensions end |
Instance Method Details
#[](name) ⇒ Object
Handles array access as access for extensions too.
60 61 62 |
# File 'lib/json-rpc-objects/v11/wd/extensions.rb', line 60 def [](name) @extensions[name.to_sym] end |
#[]=(name, value) ⇒ Object
Handles array set to extensions.
@param value of extension for set
71 72 73 |
# File 'lib/json-rpc-objects/v11/wd/extensions.rb', line 71 def []=(name, value) @extensions[name.to_sym] = value end |