Sha256: 4f8490337739e10f412e39b1239b1ba4a1137747122abaf68f8c628241db0a23

Contents?: true

Size: 828 Bytes

Versions: 1

Compression:

Stored size: 828 Bytes

Contents

module Neuron
  module Client
    class Report
      include Base

      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
      ]

      attr_accessor *ATTRIBUTES
      
      def attributes
        ATTRIBUTES
      end

      def status
        @state
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neuron-client-0.6.0 lib/neuron-client/model/report.rb