Module: Persistence::Object::Complex::Attributes::DefaultAtomicNonAtomic
- Defined in:
- lib/persistence/object/complex/attributes/default_atomic_non_atomic.rb
Overview
Module used for common methods for persistent attributes hash and arrays.
Instance Method Summary collapse
-
#default_atomic! ⇒ Object
Set attributes to default atomic.
-
#default_atomic? ⇒ true, false
Query whether attributes default to be atomic.
-
#default_atomic_without_hooks! ⇒ Object
Set attributes to default atomic.
-
#default_non_atomic! ⇒ Object
Set attributes to default non-atomic.
-
#default_non_atomic? ⇒ true, false
Query whether attributes default to be non-atomic.
-
#default_non_atomic_without_hooks! ⇒ Object
Set attributes to default non-atomic.
Instance Method Details
#default_atomic! ⇒ Object
Set attributes to default atomic.
44 45 46 47 48 |
# File 'lib/persistence/object/complex/attributes/default_atomic_non_atomic.rb', line 44 def default_atomic! @default_atomic = true end |
#default_atomic? ⇒ true, false
Query whether attributes default to be atomic.
16 17 18 19 20 |
# File 'lib/persistence/object/complex/attributes/default_atomic_non_atomic.rb', line 16 def default_atomic? return @default_atomic end |
#default_atomic_without_hooks! ⇒ Object
Set attributes to default atomic.
Used to prevent loops when array/hash relays to other arrays/hashes.
60 61 62 63 64 65 66 67 68 |
# File 'lib/persistence/object/complex/attributes/default_atomic_non_atomic.rb', line 60 def default_atomic_without_hooks! @without_hooks = true default_atomic! @without_hooks = false end |
#default_non_atomic! ⇒ Object
Set attributes to default non-atomic.
77 78 79 80 81 |
# File 'lib/persistence/object/complex/attributes/default_atomic_non_atomic.rb', line 77 def default_non_atomic! @default_atomic = false end |
#default_non_atomic? ⇒ true, false
Query whether attributes default to be non-atomic.
31 32 33 34 35 |
# File 'lib/persistence/object/complex/attributes/default_atomic_non_atomic.rb', line 31 def default_non_atomic? return ! @default_atomic end |
#default_non_atomic_without_hooks! ⇒ Object
Set attributes to default non-atomic. Used to prevent loops when array/hash relays to other arrays/hashes.
92 93 94 95 96 97 98 99 100 |
# File 'lib/persistence/object/complex/attributes/default_atomic_non_atomic.rb', line 92 def default_non_atomic_without_hooks! @without_hooks = true default_non_atomic! @without_hooks = false end |