Class: Panda::Resource
- Extended by:
- CloudConnection
- Includes:
- Associations, CloudConnection, Destroyers
- Defined in:
- lib/panda/resources/resource.rb
Constant Summary
Constants included from Router
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
- .cloud ⇒ Object
-
.method_missing(method_symbol, *args, &block) ⇒ Object
delegate to the scope if the method exists.
Instance Method Summary collapse
- #cloud ⇒ Object
-
#initialize(attributes = {}) ⇒ Resource
constructor
A new instance of Resource.
- #reload ⇒ Object
Methods included from CloudConnection
Methods included from Associations
Methods included from Destroyers
Methods inherited from Base
#changed?, #id, #id=, #inspect, #new?, sti_name, #to_json
Methods included from Finders
Methods included from Builders
Methods included from Router
included, #replace_pattern_with_self_variables
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Panda::Base
Class Method Details
.cloud ⇒ Object
15 16 17 |
# File 'lib/panda/resources/resource.rb', line 15 def cloud Panda.cloud end |
.method_missing(method_symbol, *args, &block) ⇒ Object
delegate to the scope if the method exists
20 21 22 23 24 25 26 27 |
# File 'lib/panda/resources/resource.rb', line 20 def method_missing(method_symbol, *args, &block) scope = Panda::const_get("#{sti_name}Scope").new(self) if scope.respond_to?(method_symbol) scope.send(method_symbol, *args, &block) else super end end |