Class: Files::CrashReport
- Inherits:
-
Object
- Object
- Files::CrashReport
- Defined in:
- lib/files.com/models/crash_report.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
-
.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.
Instance Method Summary collapse
-
#build ⇒ Object
string.
- #build=(value) ⇒ Object
-
#comment ⇒ Object
string.
- #comment=(value) ⇒ Object
-
#email ⇒ Object
string.
- #email=(value) ⇒ Object
-
#id ⇒ Object
int64 - Crash Report ID.
- #id=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ CrashReport
constructor
A new instance of CrashReport.
-
#platform ⇒ Object
string.
- #platform=(value) ⇒ Object
-
#platform_version ⇒ Object
string.
- #platform_version=(value) ⇒ Object
-
#product_name ⇒ Object
string.
- #product_name=(value) ⇒ Object
-
#release_channel ⇒ Object
string.
- #release_channel=(value) ⇒ Object
- #save ⇒ Object
-
#version ⇒ Object
string.
- #version=(value) ⇒ Object
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 = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/crash_report.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/crash_report.rb', line 5 def @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
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/files.com/models/crash_report.rb', line 111 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: build must be an String") if params.dig(:build) and !params.dig(:build).is_a?(String) raise InvalidParameterError.new("Bad parameter: platform must be an String") if params.dig(:platform) and !params.dig(:platform).is_a?(String) raise InvalidParameterError.new("Bad parameter: product_name must be an String") if params.dig(:product_name) and !params.dig(:product_name).is_a?(String) raise InvalidParameterError.new("Bad parameter: version must be an String") if params.dig(:version) and !params.dig(:version).is_a?(String) raise InvalidParameterError.new("Bad parameter: comment must be an String") if params.dig(:comment) and !params.dig(:comment).is_a?(String) raise InvalidParameterError.new("Bad parameter: email must be an String") if params.dig(:email) and !params.dig(:email).is_a?(String) raise InvalidParameterError.new("Bad parameter: platform_version must be an String") if params.dig(:platform_version) and !params.dig(:platform_version).is_a?(String) raise InvalidParameterError.new("Bad parameter: release_channel must be an String") if params.dig(:release_channel) and !params.dig(:release_channel).is_a?(String) raise MissingParameterError.new("Parameter missing: build") unless params.dig(:build) raise MissingParameterError.new("Parameter missing: platform") unless params.dig(:platform) raise MissingParameterError.new("Parameter missing: product_name") unless params.dig(:product_name) raise MissingParameterError.new("Parameter missing: version") unless params.dig(:version) response, = Api.send_request("/crash_reports", :post, params, ) CrashReport.new(response.data, ) end |
Instance Method Details
#build ⇒ Object
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 |
#comment ⇒ Object
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 |
#email ⇒ Object
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 |
#id ⇒ Object
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 |
#platform ⇒ Object
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_version ⇒ Object
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_name ⇒ Object
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_channel ⇒ Object
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 |
#save ⇒ Object
93 94 95 96 97 98 99 100 |
# File 'lib/files.com/models/crash_report.rb', line 93 def save if @attributes[:id] raise NotImplementedError.new("The CrashReport object doesn't support updates.") else new_obj = CrashReport.create(@attributes, @options) @attributes = new_obj.attributes end end |
#version ⇒ Object
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 |