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