Class: WidgetType
- Inherits:
-
Object
- Object
- WidgetType
- Defined in:
- lib/generators/sunrise/widgets/templates/widget_type.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(value) ⇒ WidgetType
constructor
A new instance of WidgetType.
- #title ⇒ Object
Constructor Details
#initialize(value) ⇒ WidgetType
Returns a new instance of WidgetType.
2 3 4 |
# File 'lib/generators/sunrise/widgets/templates/widget_type.rb', line 2 def initialize(value) @code = value.to_s end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
5 6 7 |
# File 'lib/generators/sunrise/widgets/templates/widget_type.rb', line 5 def code @code end |
Instance Method Details
#title ⇒ Object
7 8 9 |
# File 'lib/generators/sunrise/widgets/templates/widget_type.rb', line 7 def title I18n.t(@code, :scope => [:widgets, :type, :title]) end |