Class: Mistri::Usage::Cost
- Inherits:
-
Data
- Object
- Data
- Mistri::Usage::Cost
- Defined in:
- lib/mistri/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.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#cache_read ⇒ Object (readonly)
Returns the value of attribute cache_read
12 13 14 |
# File 'lib/mistri/usage.rb', line 12 def cache_read @cache_read end |
#cache_write ⇒ Object (readonly)
Returns the value of attribute cache_write
12 13 14 |
# File 'lib/mistri/usage.rb', line 12 def cache_write @cache_write end |
#input ⇒ Object (readonly)
Returns the value of attribute input
12 13 14 |
# File 'lib/mistri/usage.rb', line 12 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output
12 13 14 |
# File 'lib/mistri/usage.rb', line 12 def output @output end |
#total ⇒ Object (readonly)
Returns the value of attribute total
12 13 14 |
# File 'lib/mistri/usage.rb', line 12 def total @total end |
Class Method Details
.zero ⇒ Object
13 |
# File 'lib/mistri/usage.rb', line 13 def self.zero = new(input: 0.0, output: 0.0, cache_read: 0.0, cache_write: 0.0, total: 0.0) |
Instance Method Details
#+(other) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/mistri/usage.rb', line 15 def +(other) self.class.new(input: input + other.input, output: output + other.output, cache_read: cache_read + other.cache_read, cache_write: cache_write + other.cache_write, total: total + other.total) end |