Exception: StoreAgent::InvalidNodeTypeError
- Inherits:
-
StandardError
- Object
- StandardError
- StoreAgent::InvalidNodeTypeError
- Defined in:
- lib/store_agent/exceptions.rb
Overview
ファイルのコピー/移動時に、コピー元とコピー先の種類が違う場合に発生する例外クラス
workspace.directory("path/to/directory").copy("path/to/file")
# => ディレクトリのコピー先にファイルが存在する場合、例外が発生する
Instance Attribute Summary collapse
-
#dest_object ⇒ Object
readonly
:nodoc:.
-
#src_object ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#initialize(src_object: nil, dest_object: nil) ⇒ InvalidNodeTypeError
constructor
A new instance of InvalidNodeTypeError.
-
#to_s ⇒ Object
:nodoc:.
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_object ⇒ Object (readonly)
:nodoc:
30 31 32 |
# File 'lib/store_agent/exceptions.rb', line 30 def dest_object @dest_object end |
#src_object ⇒ Object (readonly)
:nodoc:
30 31 32 |
# File 'lib/store_agent/exceptions.rb', line 30 def src_object @src_object end |
Instance Method Details
#to_s ⇒ Object
: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 |