class ZendeskAppsSupport::AppVersion

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

* deprecated -- we will still serve apps targeting the deprecated version,
                but newly created or updated apps CANNOT target it
* 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
TO_BE_SERVED
VALID_FOR_UPDATE

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 58
def ==(other)
  @version == other.to_s
end
blank?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 42
def blank?
  @version.nil? || @version == ''
end
deprecated?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 34
def deprecated?
  @version == DEPRECATED
end
obsolete?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 38
def obsolete?
  !servable?
end
present?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 46
def present?
  !blank?
end
servable?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 26
def servable?
  TO_BE_SERVED.include?(@version)
end
to_json(*) click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 54
def to_json(*)
  @version.inspect
end
to_s() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 50
def to_s
  @version
end
valid_for_update?() click to toggle source
# File lib/zendesk_apps_support/app_version.rb, line 30
def valid_for_update?
  VALID_FOR_UPDATE.include?(@version)
end