Module: ActiveModel::AttributeFilters::Common::Pick::ClassMethods

Defined in:
lib/attribute-filters/common_filters/pick.rb

Overview

This submodule contains class methods used to easily define filter.

Instance Method Summary collapse

Instance Method Details

#pick_attributes(*args) ⇒ Object Also known as: pick_attribute, picks_attribute, picks_attributes

Registers attributes that should be picked.



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/attribute-filters/common_filters/pick.rb', line 68

def pick_attributes(*args)
  setup_attributes_that :should_be_picked, args,
    {
      :pick_enumerable  => [:enum, :enums, :whole_enums, :shuffle_enums, :pick_enumerable],
      :pick_step        => [:step, :with_step, :each, :pick_step],
      :pick_from        => [:from, :head, :take, :first, :pick_first, :pick_head, :pick_from],
      :pick_to          => [:to, :tail, :last, :pick_last, :pick_tail, :pick_to],
      :pick_range       => [:range, :pick_range],
      :pick_separator   => [:separator, :regex, :split_with, :split_separator, :pick_separator],
      :pick_join        => [:joiner, :join, :join_with, :pick_join]
    }, :pick_separator
end