class ZendeskAppsSupport::AppVersion

At any point in time, we support up to four versions:

* deprecated -- we will still serve apps targeting the deprecated version,
                but newly created or updated apps CANNOT target it
* sunsetting -- we will soon be removing support for this version;
                updated apps SHOULD target the current version, no new apps allowed
* current    -- we will serve apps targeting the current version;
                newly created or updated apps SHOULD target it
* future     -- we will serve apps targeting the future version;
                newly created or updates apps MAY target it, but it
                may change without notice

Constants

CURRENT
DEPRECATED
FUTURE
SUNSETTING
TO_BE_SERVED
VALID_FOR_CREATE
VALID_FOR_UPDATE

Attributes

current[R]

Public Class Methods

new(version) click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 26
def initialize(version)
  @version = version.to_s.freeze
  @current = CURRENT
  freeze
end

Public Instance Methods

==(other) click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 72
def ==(other)
  @version == other.to_s
end
blank?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 56
def blank?
  @version.nil? || @version == ''
end
deprecated?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 44
def deprecated?
  DEPRECATED.include?(@version)
end
obsolete?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 52
def obsolete?
  !servable?
end
present?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 60
def present?
  !blank?
end
servable?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 32
def servable?
  TO_BE_SERVED.include?(@version)
end
sunsetting?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 48
def sunsetting?
  @version == SUNSETTING
end
to_json(*) click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 68
def to_json(*)
  @version.inspect
end
to_s() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 64
def to_s
  @version
end
valid_for_create?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 40
def valid_for_create?
  VALID_FOR_CREATE.include?(@version)
end
valid_for_update?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 36
def valid_for_update?
  VALID_FOR_UPDATE.include?(@version)
end