Class: Eotb::Report
- Inherits:
-
Object
- Object
- Eotb::Report
- Defined in:
- lib/eotb/report.rb
Class Method Summary collapse
Class Method Details
.find(query) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/eotb/report.rb', line 4 def self.find(query) configure 'find' hash = {} query.each_pair { |k, v| hash.merge!(hash_format(v, k)) } @@post.set_form_data(hash) array = JSON.parse send array.map { |a| OpenStruct.new(a) }.sort {|x ,y| y.created_on <=> x.created_on} end |
.latest ⇒ Object
15 16 17 18 19 |
# File 'lib/eotb/report.rb', line 15 def self.latest configure 'latest' array = JSON.parse(send) array.map { |a| OpenStruct.new(a) } end |
.latest_daily ⇒ Object
21 22 23 24 25 |
# File 'lib/eotb/report.rb', line 21 def self.latest_daily configure 'latest_daily' array = JSON.parse(send) array.map { |a| OpenStruct.new(a) } end |
.latest_weekly ⇒ Object
27 28 29 30 31 |
# File 'lib/eotb/report.rb', line 27 def self.latest_weekly configure 'latest_weekly' array = JSON.parse(send) array.map { |a| OpenStruct.new(a) } end |