Module: Mongoid::Semaphore::ClassMethods
- Defined in:
- lib/mongoid/semaphore/class_methods.rb
Instance Method Summary collapse
-
#__semaphore_attrs ⇒ Object
> Default Definition for semaphore value.
- #__semaphore_initial_count ⇒ Object
-
#default_sema_count(count) ⇒ Object
> Helper method for class to override default count.
Instance Method Details
#__semaphore_attrs ⇒ Object
> Default Definition for semaphore value
5 |
# File 'lib/mongoid/semaphore/class_methods.rb', line 5 def __semaphore_attrs; @_semattr ||= {:count => 1}; end |
#__semaphore_initial_count ⇒ Object
6 |
# File 'lib/mongoid/semaphore/class_methods.rb', line 6 def __semaphore_initial_count; __semaphore_attrs[:count]; end |
#default_sema_count(count) ⇒ Object
> Helper method for class to override default count
8 9 10 11 12 |
# File 'lib/mongoid/semaphore/class_methods.rb', line 8 def default_sema_count(count) count = count.to_i __semaphore_attrs[:count] = count return end |