Class: Semian::UnprotectedResource
- Inherits:
-
Object
- Object
- Semian::UnprotectedResource
- Defined in:
- lib/semian/unprotected_resource.rb
Overview
This class acts as a replacement for ‘ProtectedResource` when the semian configuration of an `Adatper` is missing or explicitly disabled
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #acquire {|_self| ... } ⇒ Object
- #count ⇒ Object
- #destroy ⇒ Object
-
#initialize(name) ⇒ UnprotectedResource
constructor
A new instance of UnprotectedResource.
- #mark_failed(error) ⇒ Object
- #request_allowed? ⇒ Boolean
- #reset ⇒ Object
- #semid ⇒ Object
- #tickets ⇒ Object
Constructor Details
#initialize(name) ⇒ UnprotectedResource
Returns a new instance of UnprotectedResource.
7 8 9 |
# File 'lib/semian/unprotected_resource.rb', line 7 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/semian/unprotected_resource.rb', line 5 def name @name end |
Instance Method Details
#acquire {|_self| ... } ⇒ Object
18 19 20 |
# File 'lib/semian/unprotected_resource.rb', line 18 def acquire(*) yield self end |
#count ⇒ Object
22 23 24 |
# File 'lib/semian/unprotected_resource.rb', line 22 def count 0 end |
#destroy ⇒ Object
15 16 |
# File 'lib/semian/unprotected_resource.rb', line 15 def destroy end |
#mark_failed(error) ⇒ Object
37 38 |
# File 'lib/semian/unprotected_resource.rb', line 37 def mark_failed(error) end |
#request_allowed? ⇒ Boolean
33 34 35 |
# File 'lib/semian/unprotected_resource.rb', line 33 def request_allowed? true end |
#reset ⇒ Object
30 31 |
# File 'lib/semian/unprotected_resource.rb', line 30 def reset end |
#semid ⇒ Object
26 27 28 |
# File 'lib/semian/unprotected_resource.rb', line 26 def semid 0 end |
#tickets ⇒ Object
11 12 13 |
# File 'lib/semian/unprotected_resource.rb', line 11 def tickets -1 end |