Class: Bosh::AwsCliPlugin::MigrationProxy

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/bosh_cli_plugin_aws/migrator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version) ⇒ MigrationProxy

Returns a new instance of MigrationProxy.


110
111
112
113
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 110

def initialize(name, version)
  @name = name
  @version = version.to_i
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.


108
109
110
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 108

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.


108
109
110
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 108

def version
  @version
end

Instance Method Details

#<=>(other) ⇒ Object


124
125
126
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 124

def <=>(other)
  version <=> other.version
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

120
121
122
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 120

def eql?(other)
  version == other.version
end

#hashObject


128
129
130
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 128

def hash
  (name.to_s + version.to_s).hash
end

#load_classObject


115
116
117
118
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 115

def load_class
  require File.join(MigrationHelper.aws_migration_directory, "#{version}_#{name}")
  Object.const_get(MigrationHelper.to_class_name(name))
end

#to_hashObject


132
133
134
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 132

def to_hash
  {"name" => name, "version" => version}
end