Class: NetNoop::Bucket
- Inherits:
-
Object
- Object
- NetNoop::Bucket
- Includes:
- Singleton
- Defined in:
- lib/netnoop/bucket.rb
Instance Attribute Summary collapse
-
#request_map ⇒ Object
Returns the value of attribute request_map.
-
#requests ⇒ Object
Returns the value of attribute requests.
Instance Method Summary collapse
- #add_request(req) ⇒ Object
- #empty_bucket ⇒ Object
-
#initialize ⇒ Bucket
constructor
A new instance of Bucket.
Constructor Details
#initialize ⇒ Bucket
Returns a new instance of Bucket.
10 11 12 |
# File 'lib/netnoop/bucket.rb', line 10 def initialize empty_bucket end |
Instance Attribute Details
#request_map ⇒ Object
Returns the value of attribute request_map.
7 8 9 |
# File 'lib/netnoop/bucket.rb', line 7 def request_map @request_map end |
#requests ⇒ Object
Returns the value of attribute requests.
8 9 10 |
# File 'lib/netnoop/bucket.rb', line 8 def requests @requests end |
Instance Method Details
#add_request(req) ⇒ Object
14 15 16 17 |
# File 'lib/netnoop/bucket.rb', line 14 def add_request(req) self.request_map[req.uri] = self.request_map[req.uri] + [req] self.requests << req end |
#empty_bucket ⇒ Object
19 20 21 22 |
# File 'lib/netnoop/bucket.rb', line 19 def empty_bucket self.request_map = Hash.new([]) self.requests = [] end |