Class: Panda::Cloud
Constant Summary
Constants included
from Router
Router::DEFAULT_FORMAT, Router::VAR_PATTERN
Instance Attribute Summary collapse
Attributes inherited from Base
#attributes, #errors
Class Method Summary
collapse
Instance Method Summary
collapse
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
included, #object_url_map
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
50
51
52
53
|
# File 'lib/panda/resources/cloud.rb', line 50
def method_missing(method_symbol, *arguments)
lazy_load
super
end
|
Instance Attribute Details
#connection ⇒ Object
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, options=nil)
super(id)
end
|
Instance Method Details
#encodings ⇒ Object
42
43
44
|
# File 'lib/panda/resources/cloud.rb', line 42
def encodings
EncodingScope.new(self)
end
|
#eu? ⇒ Boolean
25
26
27
|
# File 'lib/panda/resources/cloud.rb', line 25
def eu?
region == "eu"
end
|
#profiles ⇒ Object
46
47
48
|
# File 'lib/panda/resources/cloud.rb', line 46
def profiles
ProfileScope.new(self)
end
|
#us? ⇒ Boolean
29
30
31
|
# File 'lib/panda/resources/cloud.rb', line 29
def us?
region == "us"
end
|
#videos ⇒ Object
38
39
40
|
# File 'lib/panda/resources/cloud.rb', line 38
def videos
VideoScope.new(self)
end
|