Class: ExoLogging::IntegrationRequest

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/exologging/integration_request.rb

Constant Summary collapse

@@app_name =
'Untitled'

Class Method Summary collapse

Class Method Details

.between(from, to) ⇒ Object



18
19
20
21
22
# File 'lib/exologging/integration_request.rb', line 18

def self.between(from, to)
  IntegrationRequest.where(name: @@app_name,
                           :created_at.gte => from,
                           :created_at.lte => to)
end

.mk!(integration_id, cost) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/exologging/integration_request.rb', line 24

def self.mk!(integration_id, cost)
  x = IntegrationRequest.new
  x.name           = @@app_name
  x.integration_id = integration_id
  x.cost           = cost.to_f

  x.save!
  x
end

.set_app_name(appname) ⇒ Object



14
15
16
# File 'lib/exologging/integration_request.rb', line 14

def self.set_app_name(appname)
  @@app_name = appname
end