Module: ActiveRegulation::Containment
- Extended by:
- ActiveSupport::Concern
- Includes:
- Base
- Defined in:
- lib/active_regulation/containment.rb
Constant Summary
Constants included
from Base
Base::FALSE_VALUES, Base::TRUE_VALUES
Instance Method Summary
collapse
Instance Method Details
#contain! ⇒ Object
16
17
18
|
# File 'lib/active_regulation/containment.rb', line 16
def contain!
update(contained_at: Time.now) if uncontained?
end
|
#contained? ⇒ Boolean
24
25
26
|
# File 'lib/active_regulation/containment.rb', line 24
def contained?
!uncontained?
end
|
#to_containment ⇒ Object
32
33
34
|
# File 'lib/active_regulation/containment.rb', line 32
def to_containment
I18n.t("active_regulation.containment.#{uncontained? ? :uncontained : :contained}")
end
|
#uncontain! ⇒ Object
20
21
22
|
# File 'lib/active_regulation/containment.rb', line 20
def uncontain!
update(contained_at: nil) if contained?
end
|
#uncontained? ⇒ Boolean
28
29
30
|
# File 'lib/active_regulation/containment.rb', line 28
def uncontained?
contained_at.nil?
end
|