Sha256: 1d3834a797b661d2c83f61388001a09a99dd216318d40ffe8e0425bef93b8775
Contents?: true
Size: 565 Bytes
Versions: 94
Compression:
Stored size: 565 Bytes
Contents
class ApiError include ActiveModel::Model attr_accessor :id, :description, :resolution, :link_url attr_writer :link_text def link_text @link_text || 'Find out more' end def link=(link) @link_text = link['text'] @link_url = link['url'] end def link return nil unless @link_text && @link_url OpenStruct.new({ text: @link_text, url: @link_url, }) end def self.parse_config(errors) return [] if errors.blank? errors.map do |id, config| ApiError.new({ id: id }.merge(config)) end end end
Version data entries
94 entries across 94 versions & 1 rubygems