Module: Policy::Follower::Names Private

Defined in:
lib/policy/follower/names.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Converter of items to array of unique symbols

Class Method Summary collapse

Class Method Details

.from(*items) ⇒ Array<Symbol>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Converts items to array of unique symbols

Examples:

Policy::Follower::Names.from "foo", [:foo, "bar"], "baz"
# => [:foo, :bar, :baz]

Parameters:

  • items (Array<#to_sym>)

Returns:

  • (Array<Symbol>)


21
22
23
# File 'lib/policy/follower/names.rb', line 21

def self.from(*items)
  items.flatten.map(&:to_sym)
end