class Feathr::Api::FeathrError

Attributes

errors[RW]
status[RW]

Public Class Methods

new(status:, errors:) click to toggle source
# File lib/feathr/api/feathr_error.rb, line 8
def initialize(status:, errors:)
  @status, @errors = status, errors
end

Public Instance Methods

to_s() click to toggle source
# File lib/feathr/api/feathr_error.rb, line 12
def to_s
  str = ""
  str += "Status #{ status }\n" unless status.to_s.empty?
  str += if errors.is_a? Hash
    errors.map{ |k, v| "#{ k }: #{ v }" }.join('; ')
  elsif errors.is_a? Array
    errors.join('; ')
  else
    errors.to_s
  end
end