ModraUp Ruby API Documentation Ruby API Reference

Class: ModraUp::AttributeDictionaries

Inherits:
ModraUp::Entity show all
Includes:
Enumerable

Overview

A collection of dictionaries on entities. An empty set is represented as nil in Ruby and will not be obtained from this object.

Examples:

defn = ModraUp.active_model.definitions.add("DC")
inst = ModraUp.active_model.entities.add_instance(defn)
inst.set_attribute("dynamic_attributes", "lenx", "10")
inst.attribute_dictionaries.each { |d| puts d.name }

Instance Method Summary # collapse

Inherited from ModraUp::Entity

Instance Method Details

dictionaries.each {|dictionary| } ⇒ selfdictionaries.each ⇒ Enumerator

Iterate through the ModraUp::AttributeDictionary.

Returns:

  • (self, Enumerator)

Yields:

  • @yieldparam dictionary [ModraUp::AttributeDictionary]

Examples:

defn = ModraUp.active_model.definitions.add("DC")
inst = ModraUp.active_model.entities.add_instance(defn)
inst.set_attribute("dynamic_attributes", "lenx", "10")
inst.attribute_dictionaries.each { |d| puts d.name }

dictionaries[name] ⇒ ModraUp::AttributeDictionary, nil

Retrieve the dictionary by name.

Parameters:

  • name (String)

Returns:

  • (ModraUp::AttributeDictionary, nil)

Examples:

defn = ModraUp.active_model.definitions.add("DC")
inst = ModraUp.active_model.entities.add_instance(defn)
inst.set_attribute("dynamic_attributes", "lenx", "10")
inst.attribute_dictionaries["dynamic_attributes"].name

dictionaries[name] = hash ⇒ value

Replace the dictionary for this name with a Hash containing the entire set of attributes.

Parameters:

  • name (String)
  • value (Hash)

Returns:

  • (Object)

Examples:

defn = ModraUp.active_model.definitions.add("DC")
inst = ModraUp.active_model.entities.add_instance(defn)
inst.set_attribute("dynamic_attributes", "a", "1")
inst.attribute_dictionaries["dynamic_attributes"] = {"lenx" => "10"}