Class: Wizardly::Wizard::PageField
- Inherits:
-
Object
- Object
- Wizardly::Wizard::PageField
- Defined in:
- lib/wizardly/wizard/page.rb
Instance Attribute Summary collapse
-
#column_type ⇒ Object
readonly
Returns the value of attribute column_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #field_type ⇒ Object
-
#initialize(name, type) ⇒ PageField
constructor
A new instance of PageField.
Constructor Details
#initialize(name, type) ⇒ PageField
Returns a new instance of PageField.
40 41 42 43 44 |
# File 'lib/wizardly/wizard/page.rb', line 40 def initialize(name, type) @name = name @column_type = type.to_sym @field_type = nil end |
Instance Attribute Details
#column_type ⇒ Object (readonly)
Returns the value of attribute column_type.
38 39 40 |
# File 'lib/wizardly/wizard/page.rb', line 38 def column_type @column_type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
38 39 40 |
# File 'lib/wizardly/wizard/page.rb', line 38 def name @name end |
Instance Method Details
#field_type ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/wizardly/wizard/page.rb', line 46 def field_type @field_type ||= case @column_type when :string then :text_field when :password then :password_field when :enum then :enum_select when :text then :text_area when :boolean then :check_box when :integer, :float, :decimal then :text_field when :datetime, :timestamp, :time then :datetime_select when :date then :date_select else :text_field end end |