Sha256: e3dbc7e6b8f6e85242d7ed41aa41a7526bd56e03ad00ebe4e9f7d01c6224a43d
Contents?: true
Size: 847 Bytes
Versions: 2
Compression:
Stored size: 847 Bytes
Contents
module Panda class Resource < Base include Panda::Destroyers include Panda::Associations include Panda::CloudConnection def initialize(attributes={}) super(attributes) @attributes['cloud_id'] ||= Panda.cloud.id end class << self include Panda::CloudConnection def cloud Panda.cloud end # delegate to the scope if the method exists 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 end def cloud Panda.clouds[cloud_id] end def reload perform_reload("cloud_id" => cloud_id) reset_associations self end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
panda-1.4.1 | lib/panda/resources/resource.rb |
panda-1.4.0 | lib/panda/resources/resource.rb |