Class: Log::Analyzer::Endpoint
- Inherits:
-
Object
- Object
- Log::Analyzer::Endpoint
- Defined in:
- lib/log-analyzer/endpoint.rb
Defined Under Namespace
Classes: Value
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#method ⇒ Object
Returns the value of attribute method.
-
#uri_pattern ⇒ Object
Returns the value of attribute uri_pattern.
-
#values ⇒ Object
Returns the value of attribute values.
Class Method Summary collapse
- .all ⇒ Object
- .create(method: "", uri_pattern: "") ⇒ Object
- .endpoints ⇒ Object
- .find_by(method: "", uri_pattern: "") ⇒ Object
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(method: "", uri_pattern: "") ⇒ Endpoint
constructor
A new instance of Endpoint.
Constructor Details
#initialize(method: "", uri_pattern: "") ⇒ Endpoint
Returns a new instance of Endpoint.
5 6 7 8 9 10 |
# File 'lib/log-analyzer/endpoint.rb', line 5 def initialize(method: "", uri_pattern: "") @method = method @uri_pattern = uri_pattern @count = 0 @values = {} end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
3 4 5 |
# File 'lib/log-analyzer/endpoint.rb', line 3 def count @count end |
#method ⇒ Object
Returns the value of attribute method.
3 4 5 |
# File 'lib/log-analyzer/endpoint.rb', line 3 def method @method end |
#uri_pattern ⇒ Object
Returns the value of attribute uri_pattern.
3 4 5 |
# File 'lib/log-analyzer/endpoint.rb', line 3 def uri_pattern @uri_pattern end |
#values ⇒ Object
Returns the value of attribute values.
3 4 5 |
# File 'lib/log-analyzer/endpoint.rb', line 3 def values @values end |
Class Method Details
.all ⇒ Object
24 25 26 |
# File 'lib/log-analyzer/endpoint.rb', line 24 def self.all self.endpoints.values end |
.create(method: "", uri_pattern: "") ⇒ Object
16 17 18 |
# File 'lib/log-analyzer/endpoint.rb', line 16 def self.create(method: "", uri_pattern: "") endpoints["#{method}:#{uri_pattern}"] = self.new(method: method, uri_pattern: uri_pattern) end |
.endpoints ⇒ Object
28 29 30 |
# File 'lib/log-analyzer/endpoint.rb', line 28 def self.endpoints @endpoints ||= {} end |
.find_by(method: "", uri_pattern: "") ⇒ Object
20 21 22 |
# File 'lib/log-analyzer/endpoint.rb', line 20 def self.find_by(method: "", uri_pattern: "") endpoints["#{method}:#{uri_pattern}"] end |