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) ⇒ Object



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

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