Class: Avmtrf1::Tools::Msgraph::Error

Inherits:
EacRest::Error
  • Object
show all
Defined in:
lib/avmtrf1/tools/msgraph/error.rb

Constant Summary collapse

INVALID_TOKEN_CODE =
'InvalidAuthenticationToken'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Error

Returns a new instance of Error.



14
15
16
17
# File 'lib/avmtrf1/tools/msgraph/error.rb', line 14

def initialize(data)
  @data = data
  super(data.pretty_inspect)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



12
13
14
# File 'lib/avmtrf1/tools/msgraph/error.rb', line 12

def data
  @data
end

Instance Method Details

#codeString

Returns:

  • (String)


20
21
22
# File 'lib/avmtrf1/tools/msgraph/error.rb', line 20

def code
  data.fetch('code')
end

#invalid_token?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/avmtrf1/tools/msgraph/error.rb', line 25

def invalid_token?
  code == INVALID_TOKEN_CODE
end