Class: OnForm::Types::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/on_form/types.rb,
lib/on_form/types.rb,
lib/on_form/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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