Class: Wayfarer::Networking::Context
- Inherits:
-
Struct
- Object
- Struct
- Wayfarer::Networking::Context
- Defined in:
- lib/wayfarer/networking/context.rb
Instance Attribute Summary collapse
-
#strategy ⇒ Object
Returns the value of attribute strategy.
Instance Method Summary collapse
Instance Attribute Details
#strategy ⇒ Object
Returns the value of attribute strategy
5 6 7 |
# File 'lib/wayfarer/networking/context.rb', line 5 def strategy @strategy end |
Instance Method Details
#fetch(url) ⇒ Object
6 7 8 |
# File 'lib/wayfarer/networking/context.rb', line 6 def fetch(url) supervise { strategy.fetch(instance, url) } end |
#instance ⇒ Object
20 21 22 |
# File 'lib/wayfarer/networking/context.rb', line 20 def instance @instance ||= strategy.create end |
#live ⇒ Object
10 11 12 |
# File 'lib/wayfarer/networking/context.rb', line 10 def live supervise { strategy.live(instance) } end |
#renew ⇒ Object
14 15 16 17 18 |
# File 'lib/wayfarer/networking/context.rb', line 14 def renew strategy.destroy(instance) ensure @instance = nil end |