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'), Product.new(code: 4, name: 'sell', legacy_name: 'sell') ].freeze
- SUPPORT =
find_by!(name: 'support')
- CHAT =
find_by!(name: 'chat')
- STANDALONE_CHAT =
find_by!(name: 'standalone_chat')
- SELL =
find_by!(name: 'sell')
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.
8 9 10 11 12 |
# File 'lib/zendesk_apps_support/product.rb', line 8 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.
6 7 8 |
# File 'lib/zendesk_apps_support/product.rb', line 6 def code @code end |
#legacy_name ⇒ Object (readonly)
Returns the value of attribute legacy_name.
6 7 8 |
# File 'lib/zendesk_apps_support/product.rb', line 6 def legacy_name @legacy_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/zendesk_apps_support/product.rb', line 6 def name @name end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/zendesk_apps_support/product.rb', line 14 def self.all PRODUCTS_AVAILABLE end |