Module: Fiber::Storage
- Included in:
- Fiber
- Defined in:
- lib/fiber/storage.rb,
lib/fiber/storage/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
- #__storage__ ⇒ Object
- #initialize(*arguments, storage: true, **options, &block) ⇒ Object
- #storage ⇒ Object
- #storage=(hash) ⇒ Object
Instance Method Details
#__storage__ ⇒ Object
31 32 33 |
# File 'lib/fiber/storage.rb', line 31 def __storage__ @storage end |
#initialize(*arguments, storage: true, **options, &block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fiber/storage.rb', line 10 def initialize(*arguments, storage: true, **, &block) case storage when true @storage = Fiber.current.storage when false @storage = Fiber.current.__storage__ else @storage = storage end super(*arguments, **, &block) end |
#storage ⇒ Object
27 28 29 |
# File 'lib/fiber/storage.rb', line 27 def storage @storage.dup end |
#storage=(hash) ⇒ Object
23 24 25 |
# File 'lib/fiber/storage.rb', line 23 def storage=(hash) @storage = hash.dup end |