Class: Brute::UsageDetection::Usage
- Inherits:
-
Data
- Object
- Data
- Brute::UsageDetection::Usage
- Defined in:
- lib/brute/usage_detection/usage.rb
Instance Attribute Summary collapse
-
#cache_read ⇒ Object
readonly
Returns the value of attribute cache_read.
-
#cache_write ⇒ Object
readonly
Returns the value of attribute cache_write.
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#reasoning ⇒ Object
readonly
Returns the value of attribute reasoning.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(input: nil, output: nil, total: nil, reasoning: nil, cache_read: nil, cache_write: nil, cost: nil, raw: nil) ⇒ Usage
constructor
A new instance of Usage.
-
#to_h ⇒ Object
What a provider did not report stays out, so a reader sees the counts that are real rather than a row of nils.
Constructor Details
#initialize(input: nil, output: nil, total: nil, reasoning: nil, cache_read: nil, cache_write: nil, cost: nil, raw: nil) ⇒ Usage
Returns a new instance of Usage.
23 24 25 26 |
# File 'lib/brute/usage_detection/usage.rb', line 23 def initialize(input: nil, output: nil, total: nil, reasoning: nil, cache_read: nil, cache_write: nil, cost: nil, raw: nil) super end |
Instance Attribute Details
#cache_read ⇒ Object (readonly)
Returns the value of attribute cache_read
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def cache_read @cache_read end |
#cache_write ⇒ Object (readonly)
Returns the value of attribute cache_write
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def cache_write @cache_write end |
#cost ⇒ Object (readonly)
Returns the value of attribute cost
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def cost @cost end |
#input ⇒ Object (readonly)
Returns the value of attribute input
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def output @output end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def raw @raw end |
#reasoning ⇒ Object (readonly)
Returns the value of attribute reasoning
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def reasoning @reasoning end |
#total ⇒ Object (readonly)
Returns the value of attribute total
22 23 24 |
# File 'lib/brute/usage_detection/usage.rb', line 22 def total @total end |
Instance Method Details
#empty? ⇒ Boolean
32 |
# File 'lib/brute/usage_detection/usage.rb', line 32 def empty? = [input, output, total].all?(&:nil?) |
#to_h ⇒ Object
What a provider did not report stays out, so a reader sees the counts that are real rather than a row of nils.
30 |
# File 'lib/brute/usage_detection/usage.rb', line 30 def to_h = super.compact |