Exception: OsCtld::ResourceLocked
- Inherits:
-
StandardError
- Object
- StandardError
- OsCtld::ResourceLocked
- Defined in:
- lib/osctld/exceptions.rb
Instance Attribute Summary collapse
-
#holder ⇒ Object
readonly
Returns the value of attribute holder.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource, holder) ⇒ ResourceLocked
constructor
A new instance of ResourceLocked.
Constructor Details
#initialize(resource, holder) ⇒ ResourceLocked
Returns a new instance of ResourceLocked.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/osctld/exceptions.rb', line 85 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
#holder ⇒ Object (readonly)
Returns the value of attribute holder.
83 84 85 |
# File 'lib/osctld/exceptions.rb', line 83 def holder @holder end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
83 84 85 |
# File 'lib/osctld/exceptions.rb', line 83 def resource @resource end |