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