Class: Qiniu2Upyun::Migrating

Inherits:
Object
  • Object
show all
Defined in:
lib/qiniu2upyun/migrating.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to) ⇒ Migrating

Returns a new instance of Migrating.



5
6
7
8
9
10
11
# File 'lib/qiniu2upyun/migrating.rb', line 5

def initialize(from, to)
  @from           = from
  @to             = to
  @record         = Record.new
  @migrated_count = 0
  @skipped_count  = 0
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



3
4
5
# File 'lib/qiniu2upyun/migrating.rb', line 3

def from
  @from
end

#migrated_countObject (readonly)

Returns the value of attribute migrated_count.



3
4
5
# File 'lib/qiniu2upyun/migrating.rb', line 3

def migrated_count
  @migrated_count
end

#recordObject (readonly)

Returns the value of attribute record.



3
4
5
# File 'lib/qiniu2upyun/migrating.rb', line 3

def record
  @record
end

#skipped_countObject (readonly)

Returns the value of attribute skipped_count.



3
4
5
# File 'lib/qiniu2upyun/migrating.rb', line 3

def skipped_count
  @skipped_count
end

#toObject (readonly)

Returns the value of attribute to.



3
4
5
# File 'lib/qiniu2upyun/migrating.rb', line 3

def to
  @to
end

Instance Method Details

#perform!Object



13
14
15
16
17
# File 'lib/qiniu2upyun/migrating.rb', line 13

def perform!
  if from.is_a?(Qiniu) && to.is_a?(Upyun)
    from_qiniu_to_upyun
  end
end