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.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/osctld/exceptions.rb', line 98 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.
96 97 98 |
# File 'lib/osctld/exceptions.rb', line 96 def holder @holder end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
96 97 98 |
# File 'lib/osctld/exceptions.rb', line 96 def resource @resource end |