Class: HasArrayScopes::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/has_array_scopes/parser.rb

Overview

Parses user-supplied tag input ("comma, separated, list" or array)
into a clean Array of tag strings.

Instance Method Summary collapse

Instance Method Details

#parse(tags) ⇒ Array<String>

Returns the parsed tag list.

Returns:

  • (Array<String>)

    the parsed tag list



12
13
14
15
16
17
18
19
# File 'lib/has_array_scopes/parser.rb', line 12

def parse(tags)
  case tags
  when String
    tags.split(/ *, */)
  else
    tags
  end
end