1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

rename klass to model for clarity/consistancy

This commit is contained in:
Wesley Beary 2009-10-30 00:11:50 -07:00
parent 09fb45b7ba
commit ee39a4f78e
10 changed files with 14 additions and 14 deletions

View file

@ -13,7 +13,7 @@ module Fog
attribute :public_ip
attribute :instance
klass Fog::AWS::EC2::Address
model Fog::AWS::EC2::Address
def initialize(attributes)
@public_ip ||= []

View file

@ -10,7 +10,7 @@ module Fog
attribute :instance_id
klass Fog::AWS::EC2::Instance
model Fog::AWS::EC2::Instance
def initialize(attributes)
@instance_id ||= []

View file

@ -10,7 +10,7 @@ module Fog
attribute :key_name
klass Fog::AWS::EC2::KeyPair
model Fog::AWS::EC2::KeyPair
def initialize(attributes)
@key_name ||= []

View file

@ -10,7 +10,7 @@ module Fog
attribute :group_name
klass Fog::AWS::EC2::SecurityGroup
model Fog::AWS::EC2::SecurityGroup
def initialize(attributes)
@group_name ||= []

View file

@ -13,7 +13,7 @@ module Fog
attribute :snapshot_id
attribute :volume_id
klass Fog::AWS::EC2::Snapshot
model Fog::AWS::EC2::Snapshot
def initialize(attributes)
@snapshot_id ||= []

View file

@ -13,7 +13,7 @@ module Fog
attribute :volume_id
attribute :instance
klass Fog::AWS::EC2::Volume
model Fog::AWS::EC2::Volume
def initialize(attributes)
@volume_id ||= []

View file

@ -8,7 +8,7 @@ module Fog
class Buckets < Fog::Collection
klass Fog::AWS::S3::Bucket
model Fog::AWS::S3::Bucket
def all
data = connection.get_service.body

View file

@ -10,7 +10,7 @@ module Fog
attribute :max_keys, 'MaxKeys'
attribute :prefix, 'Prefix'
klass Fog::AWS::S3::Object
model Fog::AWS::S3::Object
def all(options = {})
bucket.collection.get(

View file

@ -11,8 +11,8 @@ module Fog
end
end
def self.klass(new_klass)
@instance = new_klass
def self.model(new_model)
@model = new_model
end
def self.aliases
@ -54,8 +54,8 @@ module Fog
data << "]>"
end
def klass
self.class.instance_variable_get('@instance')
def model
self.class.instance_variable_get('@model')
end
def merge_attributes(new_attributes = {})
@ -70,7 +70,7 @@ module Fog
end
def new(attributes = {})
klass.new(
model.new(
attributes.merge!(
:collection => self,
:connection => connection

View file

@ -8,7 +8,7 @@ module Fog
class Servers < Fog::Collection
klass Fog::Rackspace::Servers::Server
model Fog::Rackspace::Servers::Server
def all
data = connection.list_servers_details.body