Module: Scim::Kit::DynamicAttributes
- Included in:
- V2::Supportable
- Defined in:
- lib/scim/kit/dynamic_attributes.rb
Overview
Allows dynamic creation of attributes.
Instance Method Summary collapse
- #method_missing(method, *args) ⇒ Object
- #respond_to_missing?(method, _include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
7 8 9 10 11 |
# File 'lib/scim/kit/dynamic_attributes.rb', line 7 def method_missing(method, *args) return super unless respond_to_missing?(method) @dynamic_attributes[method] = args[0] end |
Instance Method Details
#respond_to_missing?(method, _include_private = false) ⇒ Boolean
13 14 15 |
# File 'lib/scim/kit/dynamic_attributes.rb', line 13 def respond_to_missing?(method, _include_private = false) @dynamic_attributes.key?(method) || super end |