Class: Serf::Middleware::ParcelFreezer
- Inherits:
-
Object
- Object
- Serf::Middleware::ParcelFreezer
- Defined in:
- lib/serf/middleware/parcel_freezer.rb
Overview
Middleware to add uuids to freeze the parcel.
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#freezer ⇒ Object
readonly
Returns the value of attribute freezer.
Instance Method Summary collapse
-
#call(parcel) ⇒ Object
Chains the call, but deep freezes the parcel.
-
#initialize(app, *args) ⇒ ParcelFreezer
constructor
A new instance of ParcelFreezer.
Constructor Details
#initialize(app, *args) ⇒ ParcelFreezer
Returns a new instance of ParcelFreezer.
17 18 19 20 21 |
# File 'lib/serf/middleware/parcel_freezer.rb', line 17 def initialize(app, *args) opts = Optser. args @app = app @freezer = opts.get :freezer, IceNine end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
11 12 13 |
# File 'lib/serf/middleware/parcel_freezer.rb', line 11 def app @app end |
#freezer ⇒ Object (readonly)
Returns the value of attribute freezer.
12 13 14 |
# File 'lib/serf/middleware/parcel_freezer.rb', line 12 def freezer @freezer end |
Instance Method Details
#call(parcel) ⇒ Object
Chains the call, but deep freezes the parcel.
25 26 27 28 |
# File 'lib/serf/middleware/parcel_freezer.rb', line 25 def call(parcel) freezer.deep_freeze parcel app.call parcel end |