Class: Datacentred::Model::Usage

Inherits:
Base
  • Object
show all
Defined in:
lib/datacentred/model/usage.rb

Overview

Usage data for a given month/year.

Data is updated every few hours for the current month.

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Datacentred::Model::Base

Instance Attribute Details

#last_updated_atTime

Returns the current value of last_updated_at

Returns:

  • (Time)

    the current value of last_updated_at



9
10
11
# File 'lib/datacentred/model/usage.rb', line 9

def last_updated_at
  @last_updated_at
end

#projects[Hash]

Returns the current value of projects

Returns:

  • ([Hash])

    the current value of projects



9
10
11
# File 'lib/datacentred/model/usage.rb', line 9

def projects
  @projects
end

Class Method Details

.find(year, month) ⇒ Usage

Retrieve account usage data for a given year/month.

Parameters:

  • year (Integer)

    The year.

  • month (Integer)

    The month.

Returns:

  • (Usage)

    Usage for given year/month pair.

Raises:



17
18
19
# File 'lib/datacentred/model/usage.rb', line 17

def self.find(year, month)
  new Request::Usage.show year, month
end