Class: Neuron::Schema::Report

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

Constant Summary collapse

SCHEMA =
self.new

Instance Method Summary collapse

Methods included from Common

#choice_of, #datetime, #errors, #id, included, #integer, #merged, #missing_or_null, #missing_or_null_or_empty_hash, #nonnull_string, #null, #nullable_string, #object_type, #object_type_or_null, #one_of, #parameters, #priority, #set_of, #slug, #timezone, #url, #uuid, #weight, #yes_no

Instance Method Details

#createObject



17
18
19
20
21
22
23
# File 'lib/neuron-client/schema/report.rb', line 17

def create
  @@create ||=
  object_type("report",
    :template => choice_of(Neuron::Client::Report::TEMPLATES),
    :parameters => report_parameters
  )
end

#indexObject



8
9
10
11
12
13
14
15
# File 'lib/neuron-client/schema/report.rb', line 8

def index
  @@index ||=
  set_of(object_type("report",
    :id => id,
    :template => choice_of(Neuron::Client::Report::TEMPLATES),
    :state => choice_of(Neuron::Client::Report::STATES)
  ))
end

#showObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/neuron-client/schema/report.rb', line 25

def show
  @@show ||=
  object_type("report",
    :id => id,
    :template => choice_of(Neuron::Client::Report::TEMPLATES),
    :state => choice_of(Neuron::Client::Report::STATES),
    :parameters => report_parameters,
    :started_at =>  datetime(:type => %w(string null)),
    :finished_at => datetime(:type => %w(string null)),
    :accessed_at => datetime(:type => %w(string null)),
    :created_at =>  datetime,
    :updated_at =>  datetime
  )
end