Class: CertificateType
- Inherits:
-
Object
- Object
- CertificateType
- Extended by:
- ActiveModel::Naming
- Includes:
- EnumField::DefineEnum
- Defined in:
- app/models/enums/certificate_type.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code) ⇒ CertificateType
constructor
A new instance of CertificateType.
- #read_attribute_for_serialization(attribute_name) ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(code) ⇒ CertificateType
Returns a new instance of CertificateType.
9 10 11 |
# File 'app/models/enums/certificate_type.rb', line 9 def initialize(code) @code = code.to_sym end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'app/models/enums/certificate_type.rb', line 7 def code @code end |
Instance Method Details
#read_attribute_for_serialization(attribute_name) ⇒ Object
17 18 19 |
# File 'app/models/enums/certificate_type.rb', line 17 def read_attribute_for_serialization(attribute_name) send(attribute_name) end |
#title ⇒ Object
13 14 15 |
# File 'app/models/enums/certificate_type.rb', line 13 def title I18n.t(name, scope: [:certificate_type]) end |