Class: ServiceType

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'app/models/enums/service_type.rb', line 5

def code
  @code
end

#themeObject (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

#titleObject



12
13
14
# File 'app/models/enums/service_type.rb', line 12

def title
  I18n.t(code, scope: [:service_type])
end