Class: Amazon::SDB::Usage

Inherits:
Object
  • Object
show all
Defined in:
lib/amazon_sdb/usage.rb

Overview

A class for accumulating usage data returned from Amazon requests. Returned by Base#usage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUsage

Returns a new instance of Usage.



8
9
10
# File 'lib/amazon_sdb/usage.rb', line 8

def initialize
  reset!
end

Instance Attribute Details

#box_usageObject (readonly)

Returns the value of attribute box_usage.



6
7
8
# File 'lib/amazon_sdb/usage.rb', line 6

def box_usage
  @box_usage
end

Instance Method Details

#<<(value) ⇒ Object



20
21
22
# File 'lib/amazon_sdb/usage.rb', line 20

def <<(value)
  @box_usage += value
end

#add_usage(value) ⇒ Object



12
13
14
# File 'lib/amazon_sdb/usage.rb', line 12

def add_usage(value)
  @box_usage += value
end

#reset!Object



16
17
18
# File 'lib/amazon_sdb/usage.rb', line 16

def reset!
  @box_usage = 0.0
end