Class: ShotgunApiRuby::Entity
- Inherits:
-
Struct
- Object
- Struct
- ShotgunApiRuby::Entity
- Defined in:
- lib/shotgun_api_ruby/entity.rb
Overview
Represent each entity returned by Shotgun
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#id ⇒ Object
Returns the value of attribute id.
-
#links ⇒ Object
Returns the value of attribute links.
-
#relationships ⇒ Object
Returns the value of attribute relationships.
-
#type ⇒ Object
Returns the value of attribute type.
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
7 8 9 10 11 12 13 14 |
# File 'lib/shotgun_api_ruby/entity.rb', line 7 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 Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
5 6 7 |
# File 'lib/shotgun_api_ruby/entity.rb', line 5 def attributes @attributes end |
#id ⇒ Object
Returns the value of attribute id
5 6 7 |
# File 'lib/shotgun_api_ruby/entity.rb', line 5 def id @id end |
#links ⇒ Object
Returns the value of attribute links
5 6 7 |
# File 'lib/shotgun_api_ruby/entity.rb', line 5 def links @links end |
#relationships ⇒ Object
Returns the value of attribute relationships
5 6 7 |
# File 'lib/shotgun_api_ruby/entity.rb', line 5 def relationships @relationships end |
#type ⇒ Object
Returns the value of attribute type
5 6 7 |
# File 'lib/shotgun_api_ruby/entity.rb', line 5 def type @type end |
Instance Method Details
#respond_to_missing?(name, _private_methods = false) ⇒ Boolean
16 17 18 |
# File 'lib/shotgun_api_ruby/entity.rb', line 16 def respond_to_missing?(name, _private_methods = false) attributes.respond_to?(name) || super end |