class ZendeskAppsSupport::Location
Constants
- LOCATIONS_AVAILABLE
-
the ids below match the enum values on the database, do not change them!
Attributes
Public Class Methods
Source
# File lib/zendesk_apps_support/location.rb, line 28 def self.all LOCATIONS_AVAILABLE end
Source
# File lib/zendesk_apps_support/location.rb, line 12 def initialize(attrs) @id = attrs.fetch(:id) raise 'Duplicate id' if Location.unique_ids.include? @id Location.unique_ids.add @id @name = attrs.fetch(:name) @orderable = attrs.fetch(:orderable, false) @collapsible = attrs.fetch(:collapsible, false) @visible = attrs.fetch(:visible, false) @product_code = attrs.fetch(:product_code) @v2_only = attrs.fetch(:v2_only, product != Product::SUPPORT) end
Source
# File lib/zendesk_apps_support/location.rb, line 8 def self.unique_ids @ids ||= Set.new end
Public Instance Methods
Source
# File lib/zendesk_apps_support/location.rb, line 24 def product Product.find_by(code: product_code) end