Class: ZendeskAppsSupport::Location
- Inherits:
-
Object
- Object
- ZendeskAppsSupport::Location
- Extended by:
- Finders
- Defined in:
- lib/zendesk_apps_support/location.rb
Constant Summary collapse
- LOCATIONS_AVAILABLE =
the ids below match the enum values on the database, do not change them!
[ Location.new(id: 1, orderable: true, name: 'top_bar', product_code: Product::SUPPORT.code), Location.new(id: 2, orderable: true, name: 'nav_bar', product_code: Product::SUPPORT.code), Location.new(id: 3, orderable: true, name: 'ticket_sidebar', product_code: Product::SUPPORT.code), Location.new(id: 4, orderable: true, name: 'new_ticket_sidebar', product_code: Product::SUPPORT.code), Location.new(id: 5, orderable: true, name: 'user_sidebar', product_code: Product::SUPPORT.code), Location.new(id: 6, orderable: true, name: 'organization_sidebar', product_code: Product::SUPPORT.code), Location.new(id: 7, orderable: false, name: 'background', product_code: Product::SUPPORT.code), Location.new(id: 8, orderable: true, name: 'chat_sidebar', product_code: Product::CHAT.code), Location.new(id: 9, orderable: false, name: 'modal', product_code: Product::SUPPORT.code, v2_only: true), Location.new(id: 10, orderable: false, name: 'ticket_editor', product_code: Product::SUPPORT.code, v2_only: true), Location.new(id: 11, orderable: false, name: 'nav_bar', product_code: Product::STANDALONE_CHAT.code, v2_only: false), Location.new(id: 12, orderable: false, name: 'system_top_bar', product_code: Product::SUPPORT.code), Location.new(id: 13, orderable: false, name: 'system_top_bar', product_code: Product::STANDALONE_CHAT.code, v2_only: false) ].freeze
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#orderable ⇒ Object
readonly
Returns the value of attribute orderable.
-
#product_code ⇒ Object
readonly
Returns the value of attribute product_code.
-
#v2_only ⇒ Object
readonly
Returns the value of attribute v2_only.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Location
constructor
A new instance of Location.
- #product ⇒ Object
Methods included from Finders
Constructor Details
#initialize(attrs) ⇒ Location
Returns a new instance of Location.
11 12 13 14 15 16 17 18 19 |
# File 'lib/zendesk_apps_support/location.rb', line 11 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) @product_code = attrs.fetch(:product_code) @v2_only = attrs.fetch(:v2_only, product != Product::SUPPORT) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/zendesk_apps_support/location.rb', line 5 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/zendesk_apps_support/location.rb', line 5 def name @name end |
#orderable ⇒ Object (readonly)
Returns the value of attribute orderable.
5 6 7 |
# File 'lib/zendesk_apps_support/location.rb', line 5 def orderable @orderable end |
#product_code ⇒ Object (readonly)
Returns the value of attribute product_code.
5 6 7 |
# File 'lib/zendesk_apps_support/location.rb', line 5 def product_code @product_code end |
#v2_only ⇒ Object (readonly)
Returns the value of attribute v2_only.
5 6 7 |
# File 'lib/zendesk_apps_support/location.rb', line 5 def v2_only @v2_only end |
Class Method Details
.all ⇒ Object
25 26 27 |
# File 'lib/zendesk_apps_support/location.rb', line 25 def self.all LOCATIONS_AVAILABLE end |
.unique_ids ⇒ Object
7 8 9 |
# File 'lib/zendesk_apps_support/location.rb', line 7 def self.unique_ids @ids ||= Set.new end |