class Admitad::AffiliatePrograms::Response

Public Class Methods

create(attributes) click to toggle source
# File lib/admitad/models/affiliate_program_response.rb, line 110
def self.create(attributes)
  if Constants::ERRORS.any? { |error| attributes.key?(error) }
    Error.new(attributes)
  elsif attributes['results']
    new(attributes)
  elsif attributes['success']
    Success.new(attributes)
  else
    AffiliateProgram.new(attributes)
  end
end