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

Replace alias with alias_method

Done with `rubocop --auto-correct --only Alias`
This commit is contained in:
Paul Thornthwaite 2014-05-23 01:59:34 +01:00
parent 6c6a118234
commit 814cb82f22
42 changed files with 61 additions and 61 deletions

View file

@ -218,10 +218,10 @@ module Fog
request_id.join('-')
end
class << self
alias :reserved_instances_id :request_id
alias :reserved_instances_offering_id :request_id
alias :sqs_message_id :request_id
alias :sqs_sender_id :request_id
alias_method :reserved_instances_id, :request_id
alias_method :reserved_instances_offering_id, :request_id
alias_method :sqs_message_id, :request_id
alias_method :sqs_sender_id, :request_id
end
def self.reservation_id

View file

@ -15,7 +15,7 @@ module Fog
load(result['Metrics']) # an array of attribute hashes
end
alias :each_metric_this_page :each
alias_method :each_metric_this_page, :each
def each
if !block_given?
self

View file

@ -24,7 +24,7 @@ module Fog
nil
end
alias :each_user_this_page :each
alias_method :each_user_this_page, :each
def each
if !block_given?

View file

@ -40,7 +40,7 @@ module Fog
end
end
alias :each_file_this_page :each
alias_method :each_file_this_page, :each
def each
if !block_given?
self

View file

@ -26,7 +26,7 @@ module Fog
}.merge!(params))
end
alias :apply_security_groups :apply_security_groups_to_load_balancer
alias_method :apply_security_groups, :apply_security_groups_to_load_balancer
end
class Mock
@ -51,7 +51,7 @@ module Fog
response
end
alias :apply_security_groups :apply_security_groups_to_load_balancer
alias_method :apply_security_groups, :apply_security_groups_to_load_balancer
end
end
end

View file

@ -26,7 +26,7 @@ module Fog
}.merge!(params))
end
alias :enable_subnets :attach_load_balancer_to_subnets
alias_method :enable_subnets, :attach_load_balancer_to_subnets
end
class Mock
@ -51,7 +51,7 @@ module Fog
response
end
alias :enable_subnets :attach_load_balancer_to_subnets
alias_method :enable_subnets, :attach_load_balancer_to_subnets
end
end
end

View file

@ -27,7 +27,7 @@ module Fog
}.merge!(params))
end
alias :deregister_instances :deregister_instances_from_load_balancer
alias_method :deregister_instances, :deregister_instances_from_load_balancer
end
class Mock
@ -54,7 +54,7 @@ module Fog
response
end
alias :deregister_instances :deregister_instances_from_load_balancer
alias_method :deregister_instances, :deregister_instances_from_load_balancer
end
end
end

View file

@ -26,7 +26,7 @@ module Fog
}.merge!(params))
end
alias :disable_subnets :detach_load_balancer_from_subnets
alias_method :disable_subnets, :detach_load_balancer_from_subnets
end
class Mock
@ -51,7 +51,7 @@ module Fog
response
end
alias :disable_subnets :detach_load_balancer_from_subnets
alias_method :disable_subnets, :detach_load_balancer_from_subnets
end
end
end

View file

@ -26,7 +26,7 @@ module Fog
}.merge!(params))
end
alias :disable_zones :disable_availability_zones_for_load_balancer
alias_method :disable_zones, :disable_availability_zones_for_load_balancer
end
class Mock
@ -50,7 +50,7 @@ module Fog
response
end
alias :disable_zones :disable_availability_zones_for_load_balancer
alias_method :disable_zones, :disable_availability_zones_for_load_balancer
end
end
end

View file

@ -26,7 +26,7 @@ module Fog
}.merge!(params))
end
alias :enable_zones :enable_availability_zones_for_load_balancer
alias_method :enable_zones, :enable_availability_zones_for_load_balancer
end
class Mock
@ -51,7 +51,7 @@ module Fog
response
end
alias :enable_zones :enable_availability_zones_for_load_balancer
alias_method :enable_zones, :enable_availability_zones_for_load_balancer
end
end
end

View file

@ -27,7 +27,7 @@ module Fog
}.merge!(params))
end
alias :register_instances :register_instances_with_load_balancer
alias_method :register_instances, :register_instances_with_load_balancer
end
class Mock
@ -55,7 +55,7 @@ module Fog
response
end
alias :register_instances :register_instances_with_load_balancer
alias_method :register_instances, :register_instances_with_load_balancer
end
end
end

View file

@ -18,7 +18,7 @@ module Fog
def drive=(new_drive)
attributes[:drive] = new_drive
end
alias :volume :drive
alias_method :volume, :drive
end
end
end

View file

@ -60,7 +60,7 @@ module Fog
true
end
alias :delete :destroy
alias_method :delete, :destroy
def start(start_params={})
requires :identity

View file

@ -22,7 +22,7 @@ module Fog
merge_attributes(new_attributes)
end
alias :save :update
alias_method :save, :update
end
end
end

View file

@ -55,7 +55,7 @@ module Fog
true
end
alias :delete :destroy
alias_method :delete, :destroy
def clone(clone_params={})
requires :identity

View file

@ -50,7 +50,7 @@ module Fog
def flavor
service.disk_offerings.get(self.disk_offering_id)
end
alias disk_offering flavor
alias_method :disk_offering, :flavor
def server
if server_id

View file

@ -34,7 +34,7 @@ module Fog
href.scan(/\d+/)[0]
end
alias destroy delete
alias_method :destroy, :delete
end
end
end

View file

@ -90,7 +90,7 @@ module Fog
service_data
end
alias destroy delete
alias_method :destroy, :delete
end
end
end

View file

@ -38,7 +38,7 @@ module Fog
href.scan(/\d+/)[0]
end
alias destroy delete
alias_method :destroy, :delete
end
end
end

View file

@ -71,7 +71,7 @@ module Fog
href.scan(/\d+/)[0]
end
alias :vdcs :environments
alias_method :vdcs, :environments
end
end
end

View file

@ -49,7 +49,7 @@ module Fog
href.scan(/\d+/)[0]
end
alias destroy delete
alias_method :destroy, :delete
end
end
end

View file

@ -316,7 +316,7 @@ module Fog
true
end
alias destroy delete
alias_method :destroy, :delete
end
end
end

View file

@ -40,7 +40,7 @@ module Fog
end
end
alias :each_file_this_page :each
alias_method :each_file_this_page, :each
def each
if !block_given?
self

View file

@ -53,7 +53,7 @@ module Fog
def in_use?
self.status == 'in-use'
end
alias :attached? :in_use?
alias_method :attached?, :in_use?
def backing_up?
self.status == 'backing-up'

View file

@ -29,7 +29,7 @@ module Fog
service.detach_volume(server_id, volume_id)
true
end
alias :detach :destroy
alias_method :detach, :destroy
private
def server

View file

@ -33,7 +33,7 @@ module Fog
end
end
alias :each_file_this_page :each
alias_method :each_file_this_page, :each
def each
if !block_given?
self

View file

@ -55,8 +55,8 @@ module Fog
def id
Fog::Mock.random_numbers(7).to_i.to_s
end
alias :instance_id :id
alias :request_id :id
alias_method :instance_id, :id
alias_method :request_id, :id
def primary_ip
{ "type" => 0, "ip" => Fog::IBM::Mock.ip_address, "hostname" => Fog::IBM::Mock.hostname }

View file

@ -182,7 +182,7 @@ module Fog
}.merge(opts)
service.create_image(id, options[:name], options[:description]).body
end
alias :create_image :to_image
alias_method :create_image, :to_image
end
end
end

View file

@ -204,10 +204,10 @@ module Fog
request_id.join('-')
end
class << self
alias :reserved_instances_id :request_id
alias :reserved_instances_offering_id :request_id
alias :sqs_message_id :request_id
alias :sqs_sender_id :request_id
alias_method :reserved_instances_id, :request_id
alias_method :reserved_instances_offering_id, :request_id
alias_method :sqs_message_id, :request_id
alias_method :sqs_sender_id, :request_id
end
def self.reservation_id

View file

@ -40,7 +40,7 @@ module Fog
end
end
alias :each_file_this_page :each
alias_method :each_file_this_page, :each
def each
if !block_given?
self

View file

@ -115,9 +115,9 @@ module Fog
end
#alias methods
alias :halt :poweroff
alias :stop :shutdown
alias :active? :active
alias_method :halt, :poweroff
alias_method :stop, :shutdown
alias_method :active?, :active
def volumes
# lazy loading of volumes

View file

@ -33,7 +33,7 @@ module Fog
end
end
alias :each_file_this_page :each
alias_method :each_file_this_page, :each
def each
if !block_given?
self

View file

@ -49,7 +49,7 @@ module Fog
service.delete_attachment(server_id, volume_id)
true
end
alias :detach :destroy
alias_method :detach, :destroy
private
def server

View file

@ -164,10 +164,10 @@ module Fog
super
end
alias :access_ipv4_address :ipv4_address
alias :access_ipv4_address= :ipv4_address=
alias :access_ipv6_address :ipv6_address
alias :access_ipv6_address= :ipv6_address=
alias_method :access_ipv4_address, :ipv4_address
alias_method :access_ipv4_address=, :ipv4_address=
alias_method :access_ipv6_address, :ipv6_address
alias_method :access_ipv6_address=, :ipv6_address=
# Server metadata
# @return [Fog::Compute::RackspaceV2::Metadata] metadata key value pairs.

View file

@ -16,7 +16,7 @@ module Fog
load(data.body['records'])
end
alias :each_record_this_page :each
alias_method :each_record_this_page, :each
def each
requires :zone

View file

@ -22,7 +22,7 @@ module Fog
load(body['domains'])
end
alias :each_zone_this_page :each
alias_method :each_zone_this_page, :each
def each
return self unless block_given?

View file

@ -28,7 +28,7 @@ module Fog
# If limit is not specified, limit defaults to 10.
attribute :messages
alias :id :identity
alias_method :id, :identity
# Creates or updates a claim
#

View file

@ -34,7 +34,7 @@ module Fog
match = href.match(/\A.*\/queues\/[a-zA-Z0-9_-]{0,64}\/messages\/(.+?)(?:\?|\z)/i)
match ? match[1] : nil
end
alias :id :identity
alias_method :id, :identity
# Creates messages
# Requires queue, client_id, body, and ttl attributes to be populated

View file

@ -66,7 +66,7 @@ module Fog
# @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500
# @raise [Fog::Storage::Rackspace::ServiceError]
# @note This method retrieves files in pages. Page size is defined by the limit attribute
alias :each_file_this_page :each
alias_method :each_file_this_page, :each
def each
if !block_given?
self

View file

@ -275,7 +275,7 @@ module Fog
sleep 2 # API lies. need to give it some time to be happy.
service.delete_vapp(href).body[:status] == "running"
end
alias :delete :destroy
alias_method :delete, :destroy
private

View file

@ -5,7 +5,7 @@ module Fog
SAVE_MUTEX = Mutex.new
identity :mac
alias :id :mac
alias_method :id, :mac
attribute :network
attribute :name

View file

@ -44,7 +44,7 @@ module Fog
def default_sr=(sr)
service.set_attribute( 'pool', reference, 'default_SR', sr.reference )
end
alias :default_storage_repository= :default_sr=
alias_method :default_storage_repository=, :default_sr=
def default_storage_repository
default_sr