Exception: ChefFS::FileSystem::OperationNotAllowedError

Inherits:
FileSystemError
  • Object
show all
Defined in:
lib/chef_fs/file_system/operation_not_allowed_error.rb

Direct Known Subclasses

DefaultEnvironmentCannotBeModifiedError

Instance Attribute Summary collapse

Attributes inherited from FileSystemError

#cause

Instance Method Summary collapse

Constructor Details

#initialize(operation, entry, cause = nil) ⇒ OperationNotAllowedError

Returns a new instance of OperationNotAllowedError.



24
25
26
27
# File 'lib/chef_fs/file_system/operation_not_allowed_error.rb', line 24

def initialize(operation, entry, cause = nil)
  super(entry, cause)
  @operation = operation
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



30
31
32
# File 'lib/chef_fs/file_system/operation_not_allowed_error.rb', line 30

def entry
  @entry
end

#operationObject (readonly)

Returns the value of attribute operation.



29
30
31
# File 'lib/chef_fs/file_system/operation_not_allowed_error.rb', line 29

def operation
  @operation
end

Instance Method Details

#reasonObject



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/chef_fs/file_system/operation_not_allowed_error.rb', line 32

def reason
  case operation
  when :delete
    "cannot be deleted"
  when :write
    "cannot be updated"
  when :create_child
    "cannot have a child created under it"
  when :read
    "cannot be read"
  end
end