Exception: OsCtld::ResourceLocked

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource, holder) ⇒ ResourceLocked

Returns a new instance of ResourceLocked



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/osctld/exceptions.rb', line 83

def initialize(resource, holder)
  @resource = resource
  @holder = holder

  resource_ident = ['resource', resource.class.name]
  holder_ident = holder.class.name

  if resource.respond_to?(:manipulation_resource)
    resource_ident = resource.manipulation_resource
  end

  if holder.respond_to?(:manipulation_holder)
    holder_ident = holder.manipulation_holder
  end

  super("#{resource_ident[0]} #{resource_ident[1]} is held by #{holder_ident}")
end

Instance Attribute Details

#holderObject (readonly)

Returns the value of attribute holder



81
82
83
# File 'lib/osctld/exceptions.rb', line 81

def holder
  @holder
end

#resourceObject (readonly)

Returns the value of attribute resource



81
82
83
# File 'lib/osctld/exceptions.rb', line 81

def resource
  @resource
end