Class: WidgetType

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/sunrise/widgets/templates/widget_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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

#titleObject



7
8
9
# File 'lib/generators/sunrise/widgets/templates/widget_type.rb', line 7

def title
  I18n.t(@code, :scope => [:widgets, :type, :title])
end