Exception: Cyby::Kintone::InvalidRecord

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cyby/kintone/invalid_record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ InvalidRecord

Returns a new instance of InvalidRecord.



6
7
8
9
10
11
12
13
# File 'lib/cyby/kintone/invalid_record.rb', line 6

def initialize(response)
  @response = response
  @message = @response["message"]
  @id = @response["id"]
  @code = @response["code"]
  @response_code = @response.code
  set_errors
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/cyby/kintone/invalid_record.rb', line 4

def code
  @code
end

#errorsObject (readonly)

Returns the value of attribute errors.



4
5
6
# File 'lib/cyby/kintone/invalid_record.rb', line 4

def errors
  @errors
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/cyby/kintone/invalid_record.rb', line 4

def id
  @id
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/cyby/kintone/invalid_record.rb', line 4

def message
  @message
end

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/cyby/kintone/invalid_record.rb', line 4

def response
  @response
end

#response_codeObject (readonly)

Returns the value of attribute response_code.



4
5
6
# File 'lib/cyby/kintone/invalid_record.rb', line 4

def response_code
  @response_code
end

Instance Method Details

#inspectObject



15
16
17
18
19
20
21
22
23
# File 'lib/cyby/kintone/invalid_record.rb', line 15

def inspect
  {
    message: @message,
    id: @id,
    code: @code,
    response_code: @response_code,
    errors: @errors
  }.inspect
end

#to_sObject



25
26
27
# File 'lib/cyby/kintone/invalid_record.rb', line 25

def to_s
  "InvalidRecord: #{inspect}"
end