Module: CC::Yaml::Nodes

Defined in:
lib/cc/yaml/nodes.rb,
lib/cc/yaml/nodes/node.rb,
lib/cc/yaml/nodes/root.rb,
lib/cc/yaml/nodes/engine.rb,
lib/cc/yaml/nodes/scalar.rb,
lib/cc/yaml/nodes/mapping.rb,
lib/cc/yaml/nodes/sequence.rb,
lib/cc/yaml/nodes/engine_list.rb,
lib/cc/yaml/nodes/exclude_path.rb,
lib/cc/yaml/nodes/open_mapping.rb,
lib/cc/yaml/nodes/exclude_path_list.rb

Defined Under Namespace

Classes: Engine, EngineList, ExcludePath, ExcludePathList, Mapping, Node, OpenMapping, Root, Scalar, Sequence

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object

Raises:

  • (ArgumentError)


15
16
17
18
19
20
# File 'lib/cc/yaml/nodes.rb', line 15

def self.[](key)
  return key if key.respond_to? :new
  name = constants.detect { |c| c.downcase == key }
  raise ArgumentError, "unknown node type %p" % key unless name
  const_get(name)
end