Class: Panda::Cloud
Constant Summary
Constants included from Router
Router::DEFAULT_FORMAT, Router::VAR_PATTERN
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
- #encodings ⇒ Object
-
#initialize(attributes = {}) ⇒ Cloud
constructor
A new instance of Cloud.
- #method_missing(method_symbol, *arguments) ⇒ Object
- #profiles ⇒ Object
- #videos ⇒ Object
Methods included from Finders::FindOne
find, find_by_path, find_object_by_path
Methods included from Updatable
#save, #save!, #update, #update_attribute, #update_attributes
Methods inherited from Base
#changed?, #delete, end_class_name, id, #id, #id=, #new?, #reload, #to_json
Methods included from Router
Constructor Details
#initialize(attributes = {}) ⇒ Cloud
Returns a new instance of Cloud.
6 7 8 9 10 11 |
# File 'lib/panda/resources/cloud.rb', line 6 def initialize(attributes={}) super(attributes) connection_params = Panda.connection.to_hash.merge!(:cloud_id => id, :format => :hash) @connection = Connection.new(connection_params) Panda.clouds[id] = self end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_symbol, *arguments) ⇒ Object
37 38 39 40 |
# File 'lib/panda/resources/cloud.rb', line 37 def method_missing(method_symbol, *arguments) lazy_load super end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
4 5 6 |
# File 'lib/panda/resources/cloud.rb', line 4 def connection @connection end |
Class Method Details
.connection ⇒ Object
20 21 22 |
# File 'lib/panda/resources/cloud.rb', line 20 def connection Panda.connection end |
.find(id, options = nil) ⇒ Object
16 17 18 |
# File 'lib/panda/resources/cloud.rb', line 16 def find(id, =nil) super(id) end |
Instance Method Details
#encodings ⇒ Object
29 30 31 |
# File 'lib/panda/resources/cloud.rb', line 29 def encodings EncodingScope.new(self) end |
#profiles ⇒ Object
33 34 35 |
# File 'lib/panda/resources/cloud.rb', line 33 def profiles ProfileScope.new(self) end |
#videos ⇒ Object
25 26 27 |
# File 'lib/panda/resources/cloud.rb', line 25 def videos VideoScope.new(self) end |