Class: Bosh::Aws::MigrationProxy
- Inherits:
-
Object
- Object
- Bosh::Aws::MigrationProxy
- Includes:
- Comparable
- Defined in:
- lib/bosh_cli_plugin_aws/migrator.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name, version) ⇒ MigrationProxy
constructor
A new instance of MigrationProxy.
- #load_class ⇒ Object
- #to_hash ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
108 109 110 |
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 108 def name @name end |
#version ⇒ Object (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
120 121 122 |
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 120 def eql?(other) version == other.version end |
#hash ⇒ Object
128 129 130 |
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 128 def hash (name.to_s + version.to_s).hash end |
#load_class ⇒ Object
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_hash ⇒ Object
132 133 134 |
# File 'lib/bosh_cli_plugin_aws/migrator.rb', line 132 def to_hash {"name" => name, "version" => version} end |