Exception: Apimaster::NormalError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/apimaster/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = '', code = nil, error = :invalid, resource = nil, field = nil) ⇒ NormalError

error :missing, :missing_field, :invalid, :already_exists



16
17
18
19
20
21
22
# File 'lib/apimaster/error.rb', line 16

def initialize(message = '', code = nil, error = :invalid, resource = nil, field = nil)
  @code = code
  @error = error.to_sym
  @resource = resource
  @field = field
  super(message)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



10
11
12
# File 'lib/apimaster/error.rb', line 10

def code
  @code
end

#errorObject (readonly)

Returns the value of attribute error.



11
12
13
# File 'lib/apimaster/error.rb', line 11

def error
  @error
end

#fieldObject (readonly)

Returns the value of attribute field.



13
14
15
# File 'lib/apimaster/error.rb', line 13

def field
  @field
end

#resourceObject (readonly)

Returns the value of attribute resource.



12
13
14
# File 'lib/apimaster/error.rb', line 12

def resource
  @resource
end