class ParameterSets::SchemaDSL

Attributes

fields[R]

Public Class Methods

new() click to toggle source
# File lib/parameter_sets/schema_dsl.rb, line 4
def initialize
  @fields = []
end

Public Instance Methods

permit(field, *other_fields) click to toggle source
# File lib/parameter_sets/schema_dsl.rb, line 10
def permit(field, *other_fields)
  if other_fields[0].is_a?(Symbol)
    permit(field)
    other_fields.each { |field| permit(field) }
  else
    if options = other_fields[0]
      @fields << {field => options}
    else
      @fields << field
    end
  end
end