Class: ServiceType
- Inherits:
-
Object
- Object
- ServiceType
- Includes:
- EnumField::DefineEnum
- Defined in:
- app/models/enums/service_type.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#theme ⇒ Object
readonly
Returns the value of attribute theme.
Instance Method Summary collapse
-
#initialize(code, theme = :default) ⇒ ServiceType
constructor
A new instance of ServiceType.
- #title ⇒ Object
Constructor Details
#initialize(code, theme = :default) ⇒ ServiceType
Returns a new instance of ServiceType.
7 8 9 10 |
# File 'app/models/enums/service_type.rb', line 7 def initialize(code, theme = :default) @code = code.to_sym @theme = theme end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'app/models/enums/service_type.rb', line 5 def code @code end |
#theme ⇒ Object (readonly)
Returns the value of attribute theme.
5 6 7 |
# File 'app/models/enums/service_type.rb', line 5 def theme @theme end |
Instance Method Details
#title ⇒ Object
12 13 14 |
# File 'app/models/enums/service_type.rb', line 12 def title I18n.t(code, scope: [:service_type]) end |