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