lib/onoma/nomenclature.rb
# Add an item to the nomenclature
Add an item to the nomenclature
Add an item to the nomenclature
def add_item(name, attributes = {}, options = {})
      i = Item.new(self, name, attributes)
      if @items[i.name]
        raise "Item #{i.name} is already defined in nomenclature #{@name}"
      end
      @items[i.name] = i
      @roots << i unless i.parent?
      i.rebuild_tree! unless options[:rebuild].is_a?(FalseClass)
      i
    end
def add_item ( name , attributes = { } , options = { } ) i = Item . new ( self , name , attributes ) if @items [ i . name ] raise "Item #{i.name} is already defined in nomenclature #{@name}" end @items [ i . name ] = i @roots << i unless i . parent? i . rebuild_tree! unless options [ :rebuild ] . is_a? ( FalseClass ) i end
Add an item to the nomenclature
Add an item to the nomenclature
name
<not_specific>
attributes
<not_specific>
options
<not_specific>