Class: CategoryType

Inherits:
Object
  • Object
show all
Includes:
EnumField::DefineEnum
Defined in:
app/models/enums/category_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, attachment_type = :any) ⇒ CategoryType

Returns a new instance of CategoryType.



8
9
10
11
# File 'app/models/enums/category_type.rb', line 8

def initialize(code, attachment_type = :any)
  @code = code.to_sym
  @attachment_type = attachment_type
end

Instance Attribute Details

#attachment_typeObject (readonly)

Returns the value of attribute attachment_type.



6
7
8
# File 'app/models/enums/category_type.rb', line 6

def attachment_type
  @attachment_type
end

#codeObject (readonly)

Returns the value of attribute code.



6
7
8
# File 'app/models/enums/category_type.rb', line 6

def code
  @code
end

Instance Method Details

#titleObject



13
14
15
# File 'app/models/enums/category_type.rb', line 13

def title
  I18n.t(name, scope: [:category_type])
end