class Admitad::AdSpaces::Response

Public Class Methods

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