Class: Files::CrashReport

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/crash_report.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ CrashReport

Returns a new instance of CrashReport.



7
8
9
10
# File 'lib/files.com/models/crash_report.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/crash_report.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/crash_report.rb', line 5

def options
  @options
end

Class Method Details

.create(params = {}, options = {}) ⇒ Object

Parameters:

build (required) - string
platform (required) - string
product_name (required) - string
version (required) - string
comment - string
email - string
platform_version - string
release_channel - string
dump_file - file
log_file - file


133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/files.com/models/crash_report.rb', line 133

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: build must be an String") if params[:build] and !params[:build].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: platform must be an String") if params[:platform] and !params[:platform].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: product_name must be an String") if params[:product_name] and !params[:product_name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: version must be an String") if params[:version] and !params[:version].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: comment must be an String") if params[:comment] and !params[:comment].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: email must be an String") if params[:email] and !params[:email].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: platform_version must be an String") if params[:platform_version] and !params[:platform_version].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: release_channel must be an String") if params[:release_channel] and !params[:release_channel].is_a?(String)
  raise MissingParameterError.new("Parameter missing: build") unless params[:build]
  raise MissingParameterError.new("Parameter missing: platform") unless params[:platform]
  raise MissingParameterError.new("Parameter missing: product_name") unless params[:product_name]
  raise MissingParameterError.new("Parameter missing: version") unless params[:version]

  response, options = Api.send_request("/crash_reports", :post, params, options)
  CrashReport.new(response.data, options)
end

Instance Method Details

#buildObject

string



22
23
24
# File 'lib/files.com/models/crash_report.rb', line 22

def build
  @attributes[:build]
end

#build=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/crash_report.rb', line 26

def build=(value)
  @attributes[:build] = value
end

#commentObject

string



58
59
60
# File 'lib/files.com/models/crash_report.rb', line 58

def comment
  @attributes[:comment]
end

#comment=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/crash_report.rb', line 62

def comment=(value)
  @attributes[:comment] = value
end

#dump_fileObject

file



94
95
96
# File 'lib/files.com/models/crash_report.rb', line 94

def dump_file
  @attributes[:dump_file]
end

#dump_file=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/crash_report.rb', line 98

def dump_file=(value)
  @attributes[:dump_file] = value
end

#emailObject

string



67
68
69
# File 'lib/files.com/models/crash_report.rb', line 67

def email
  @attributes[:email]
end

#email=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/crash_report.rb', line 71

def email=(value)
  @attributes[:email] = value
end

#idObject

int64 - Crash Report ID



13
14
15
# File 'lib/files.com/models/crash_report.rb', line 13

def id
  @attributes[:id]
end

#id=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/crash_report.rb', line 17

def id=(value)
  @attributes[:id] = value
end

#log_fileObject

file



103
104
105
# File 'lib/files.com/models/crash_report.rb', line 103

def log_file
  @attributes[:log_file]
end

#log_file=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/crash_report.rb', line 107

def log_file=(value)
  @attributes[:log_file] = value
end

#platformObject

string



31
32
33
# File 'lib/files.com/models/crash_report.rb', line 31

def platform
  @attributes[:platform]
end

#platform=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/crash_report.rb', line 35

def platform=(value)
  @attributes[:platform] = value
end

#platform_versionObject

string



76
77
78
# File 'lib/files.com/models/crash_report.rb', line 76

def platform_version
  @attributes[:platform_version]
end

#platform_version=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/crash_report.rb', line 80

def platform_version=(value)
  @attributes[:platform_version] = value
end

#product_nameObject

string



40
41
42
# File 'lib/files.com/models/crash_report.rb', line 40

def product_name
  @attributes[:product_name]
end

#product_name=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/crash_report.rb', line 44

def product_name=(value)
  @attributes[:product_name] = value
end

#release_channelObject

string



85
86
87
# File 'lib/files.com/models/crash_report.rb', line 85

def release_channel
  @attributes[:release_channel]
end

#release_channel=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/crash_report.rb', line 89

def release_channel=(value)
  @attributes[:release_channel] = value
end

#saveObject



111
112
113
114
115
116
117
118
119
120
# File 'lib/files.com/models/crash_report.rb', line 111

def save
  if @attributes[:id]
    raise NotImplementedError.new("The CrashReport object doesn't support updates.")
  else
    new_obj = CrashReport.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#versionObject

string



49
50
51
# File 'lib/files.com/models/crash_report.rb', line 49

def version
  @attributes[:version]
end

#version=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/crash_report.rb', line 53

def version=(value)
  @attributes[:version] = value
end