Class: OnForm::Types::Type
- Inherits:
-
Object
- Object
- OnForm::Types::Type
- Defined in:
- lib/on_form/types.rb,
lib/on_form/types.rb,
lib/on_form/types.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
Instance Method Summary collapse
- #cast(arg) ⇒ Object
-
#initialize(type, default) ⇒ Type
constructor
A new instance of Type.
Constructor Details
#initialize(type, default) ⇒ Type
Returns a new instance of Type.
6 7 8 9 |
# File 'lib/on_form/types.rb', line 6 def initialize(type, default) @type = type @default = default end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
4 5 6 |
# File 'lib/on_form/types.rb', line 4 def default @default end |
Instance Method Details
#cast(arg) ⇒ Object
19 20 21 |
# File 'lib/on_form/types.rb', line 19 def cast(arg) @type.cast(arg) end |