Class: Panda::Proxy

Inherits:
Object
  • Object
show all
Includes:
Builders::CreateBuilder, CloudConnection, Finders::FindMany, Finders::FindOne, Router::ClassMethods
Defined in:
lib/panda/proxies/proxy.rb

Direct Known Subclasses

Scope

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CloudConnection

#connection

Methods included from Builders::CreateBuilder

#create, #create!

Methods included from Finders::FindOne

#find, #find_by_path, #find_object_by_path

Methods included from Finders::FindMany

#all, #find_by

Methods included from Router::ClassMethods

#build_hash_many_path, #element_params, #full_object_url, #many_path, #match, #object_url, #one_path, #resource_path

Constructor Details

#initialize(parent, klass) ⇒ Proxy

Returns a new instance of Proxy.



11
12
13
14
# File 'lib/panda/proxies/proxy.rb', line 11

def initialize(parent, klass)
  @parent = parent
  @klass = klass
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Panda::Finders::FindMany

Instance Attribute Details

#klassObject

Returns the value of attribute klass.



9
10
11
# File 'lib/panda/proxies/proxy.rb', line 9

def klass
  @klass
end

#parentObject

Returns the value of attribute parent.



9
10
11
# File 'lib/panda/proxies/proxy.rb', line 9

def parent
  @parent
end

Instance Method Details

#cloudObject



16
17
18
# File 'lib/panda/proxies/proxy.rb', line 16

def cloud
  @parent.is_a?(Cloud) ? @parent : @parent.cloud
end

#end_class_nameObject



20
21
22
# File 'lib/panda/proxies/proxy.rb', line 20

def end_class_name
  klass.end_class_name
end