Module: Parametric::TypedParams::DSL

Defined in:
lib/parametric/typed_params.rb

Instance Method Summary collapse

Instance Method Details

#array(field_name, label = '', opts = {}, &block) ⇒ Object



18
19
20
# File 'lib/parametric/typed_params.rb', line 18

def array(field_name, label = '', opts = {}, &block)
  param(field_name, label, opts.merge(multiple: true), &block)
end

#integer(field_name, label = '', opts = {}, &block) ⇒ Object



10
11
12
# File 'lib/parametric/typed_params.rb', line 10

def integer(field_name, label = '', opts = {}, &block)
  param(field_name, label, opts.merge(coerce: :to_i), &block)
end

#string(field_name, label = '', opts = {}, &block) ⇒ Object



14
15
16
# File 'lib/parametric/typed_params.rb', line 14

def string(field_name, label = '', opts = {}, &block)
  param(field_name, label, opts.merge(coerce: :to_s), &block)
end