Class: ShotgridApiRuby::Entity
- Inherits:
-
T::Struct
- Object
- T::Struct
- ShotgridApiRuby::Entity
- Extended by:
- T::Sig
- Defined in:
- lib/shotgrid_api_ruby/entity.rb
Overview
Represent each entity returned by Shotgrid
Instance Method Summary collapse
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to_missing?(name, _private_methods = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/shotgrid_api_ruby/entity.rb', line 20 def method_missing(name, *args, &block) if attributes.respond_to?(name) define_singleton_method(name) { attributes.public_send(name) } public_send(name) else super end end |
Instance Method Details
#respond_to_missing?(name, _private_methods = false) ⇒ Boolean
33 34 35 |
# File 'lib/shotgrid_api_ruby/entity.rb', line 33 def respond_to_missing?(name, _private_methods = false) attributes.respond_to?(name) || super end |