Class: Neuron::Client::Report

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/neuron-client/model/report.rb

Constant Summary collapse

TEMPLATES =
%w(ad_events ad_events2 delivery_metrics delivery_metrics2 post_activities)
STATES =
%w(NEW WAITING RUNNING READY FAILED CANCELLED)
ATTRIBUTES =
[
  :id,
  :parameters, # hash, where keys are parameter names, and values are parameter values as strings.
  :state,      # string, one of STATES
  :template,   # string, one of TEMPLATES
  :created_at, # string, datetime in UTC
  :updated_at, # string, datetime in UTC
]

Instance Method Summary collapse

Methods included from Base

#apply_attributes!, #destroy, #id=, included, #initialize, #new_record?, #save, #to_create_hash, #to_hash, #to_update_hash, #update_attributes, #valid?

Methods included from Base::ClassAndInstanceMethods

#all, #api=, #create, #create!, #find, #validate=

Instance Method Details

#attributesObject



21
22
23
# File 'lib/neuron-client/model/report.rb', line 21

def attributes
  ATTRIBUTES
end

#resultObject



29
30
31
32
# File 'lib/neuron-client/model/report.rb', line 29

def result
  connected_to_admin!
  connection.get("reports/#{id}/result", :format => "")
end

#statusObject



25
26
27
# File 'lib/neuron-client/model/report.rb', line 25

def status
  @state
end