Class: Shushu::Report
- Inherits:
-
Object
- Object
- Shushu::Report
- Defined in:
- lib/models/report.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#billable_units ⇒ Object
Returns the value of attribute billable_units.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
Instance Attribute Details
#billable_units ⇒ Object
Returns the value of attribute billable_units.
3 4 5 |
# File 'lib/models/report.rb', line 3 def billable_units @billable_units end |
#from ⇒ Object
Returns the value of attribute from.
3 4 5 |
# File 'lib/models/report.rb', line 3 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
3 4 5 |
# File 'lib/models/report.rb', line 3 def to @to end |
Instance Method Details
#fetch ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/models/report.rb', line 9 def fetch url = [Shushu.url, resource].join Shushu.handle_req do RestClient.get(url, {:params => { :from => from.utc.to_s, :to => to.utc.to_s }}) end end |
#report ⇒ Object
27 28 29 |
# File 'lib/models/report.rb', line 27 def report @report ||= fetch end |
#total ⇒ Object
23 24 25 |
# File 'lib/models/report.rb', line 23 def total report["total"] end |