Class: SeametrixRuby::Responses::BadRequest
- Inherits:
-
Object
- Object
- SeametrixRuby::Responses::BadRequest
- Defined in:
- lib/seametrix_ruby/responses/bad_request.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#status ⇒ Object
Returns the value of attribute status.
-
#title ⇒ Object
Returns the value of attribute title.
-
#trace_id ⇒ Object
Returns the value of attribute trace_id.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BadRequest
constructor
A new instance of BadRequest.
Constructor Details
#initialize(attributes = {}) ⇒ BadRequest
8 9 10 11 12 13 14 |
# File 'lib/seametrix_ruby/responses/bad_request.rb', line 8 def initialize(attributes = {}) @type = attributes[:type] @title = attributes[:title] @status = attributes[:status] @trace_id = attributes[:trace_id] @errors = attributes[:errors] || {} end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
6 7 8 |
# File 'lib/seametrix_ruby/responses/bad_request.rb', line 6 def errors @errors end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/seametrix_ruby/responses/bad_request.rb', line 6 def status @status end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/seametrix_ruby/responses/bad_request.rb', line 6 def title @title end |
#trace_id ⇒ Object
Returns the value of attribute trace_id.
6 7 8 |
# File 'lib/seametrix_ruby/responses/bad_request.rb', line 6 def trace_id @trace_id end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/seametrix_ruby/responses/bad_request.rb', line 6 def type @type end |
Class Method Details
.from_json(json_string) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/seametrix_ruby/responses/bad_request.rb', line 16 def self.from_json(json_string) json = MultiJson.load(json_string) new(type: json['type'], title: json['title'], status: json['status'].to_i, trace_id: json['traceId'], errors: json['errors']) end |