Exception: StoreAgent::InvalidNodeTypeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/store_agent/exceptions.rb

Overview

ファイルのコピー/移動時に、コピー元とコピー先の種類が違う場合に発生する例外クラス

workspace.directory("path/to/directory").copy("path/to/file")
# => ディレクトリのコピー先にファイルが存在する場合、例外が発生する

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src_object: nil, dest_object: nil) ⇒ InvalidNodeTypeError

Returns a new instance of InvalidNodeTypeError.



32
33
34
35
# File 'lib/store_agent/exceptions.rb', line 32

def initialize(src_object: nil, dest_object: nil)
  @src_object = src_object
  @dest_object = dest_object
end

Instance Attribute Details

#dest_objectObject (readonly)

:nodoc:



30
31
32
# File 'lib/store_agent/exceptions.rb', line 30

def dest_object
  @dest_object
end

#src_objectObject (readonly)

:nodoc:



30
31
32
# File 'lib/store_agent/exceptions.rb', line 30

def src_object
  @src_object
end

Instance Method Details

#to_sObject

:nodoc:



37
38
39
40
41
42
43
# File 'lib/store_agent/exceptions.rb', line 37

def to_s # :nodoc:
  if @src_object && @dest_object
    "invalid node type: '#{@src_object.path}' is #{@src_object.filetype}, '#{@dest_object.path}' is #{@dest_object.filetype}"
  else
    "invalid node type"
  end
end