Class: CanTango::Parser::Categories

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/permits_ext/parser/categories.rb

Instance Method Summary collapse

Instance Method Details

#parse(categories, key, obj) {|categories| ... } ⇒ Object

Yields:

  • (categories)


4
5
6
7
8
9
10
11
12
# File 'lib/cantango/permits_ext/parser/categories.rb', line 4

def parse categories, key, obj, &blk
  case obj
  when Array
    categories[key] = obj
  else
    raise "Each key must have a YAML hash that defines which models make up the category (related kinds of items)"
  end
  yield categories if blk
end