Class: VC::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/models/report.rb

Direct Known Subclasses

Invoice, UsageReport

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#billable_unitsObject

Returns the value of attribute billable_units.



3
4
5
# File 'lib/models/report.rb', line 3

def billable_units
  @billable_units
end

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/models/report.rb', line 3

def from
  @from
end

#toObject

Returns the value of attribute to.



3
4
5
# File 'lib/models/report.rb', line 3

def to
  @to
end

Instance Method Details

#fetchObject



9
10
11
12
13
# File 'lib/models/report.rb', line 9

def fetch
  VC.handle_req do
    RestClient.get([VC.url, resource].join, {:params => {:from => from.utc.to_s, :to => to.utc.to_s}})
  end
end

#reportObject



23
24
25
# File 'lib/models/report.rb', line 23

def report
  @report ||= fetch
end

#totalObject



19
20
21
# File 'lib/models/report.rb', line 19

def total
  report["total"]
end