Class: ZendeskAppsSupport::Product
- Inherits:
-
Object
- Object
- ZendeskAppsSupport::Product
- Extended by:
- Finders
- Defined in:
- lib/zendesk_apps_support/product.rb
Constant Summary collapse
- PRODUCTS_AVAILABLE =
The product codes below match the values in the database, do not change them!
[ Product.new(code: 1, name: 'support', legacy_name: 'zendesk'), Product.new(code: 2, name: 'chat', legacy_name: 'zopim'), Product.new(code: 3, name: 'standalone_chat', legacy_name: 'lotus_box') ].freeze
- SUPPORT =
find_by!(name: 'support')
- CHAT =
find_by!(name: 'chat')
- STANDALONE_CHAT =
find_by!(name: 'standalone_chat')
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#legacy_name ⇒ Object
readonly
Returns the value of attribute legacy_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Product
constructor
A new instance of Product.
Methods included from Finders
Constructor Details
#initialize(attrs) ⇒ Product
Returns a new instance of Product.
7 8 9 10 11 |
# File 'lib/zendesk_apps_support/product.rb', line 7 def initialize(attrs) @code = attrs.fetch(:code) @name = attrs.fetch(:name) @legacy_name = attrs.fetch(:legacy_name) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/zendesk_apps_support/product.rb', line 5 def code @code end |
#legacy_name ⇒ Object (readonly)
Returns the value of attribute legacy_name.
5 6 7 |
# File 'lib/zendesk_apps_support/product.rb', line 5 def legacy_name @legacy_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/zendesk_apps_support/product.rb', line 5 def name @name end |
Class Method Details
.all ⇒ Object
13 14 15 |
# File 'lib/zendesk_apps_support/product.rb', line 13 def self.all PRODUCTS_AVAILABLE end |