Class: CC::Yaml::Nodes::OpenMapping

Inherits:
Mapping show all
Defined in:
lib/cc/yaml/nodes/open_mapping.rb

Direct Known Subclasses

Checks, EngineList, NestedConfig

Constant Summary

Constants inherited from Mapping

Mapping::INCOMPATIBLE_KEYS_WARNING

Instance Attribute Summary

Attributes inherited from Mapping

#mapping

Attributes inherited from Node

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Mapping

#==, #[], #[]=, aliases, #deep_verify, define_map_accessor, #each_scalar, #empty?, #include?, #inspect, map, #mapped_key, mapping, #nested_warnings, prefix_scalar, #prepare, required, #set_warnings, subnode_for_key, #verify, #verify_errors, #verify_required, #visit_key_value, #visit_mapping, #visit_pair, #with_value!

Methods inherited from Node

#as_json, #deep_verify, #dup, #error, #errors, #errors?, has_default?, #initialize, #method_missing, #nested_warning, #nested_warnings, #prepare, #respond_to_missing?, #to_s, #verify, #visit_child, #visit_mapping, #visit_pair, #visit_scalar, #visit_sequence, #visit_unexpected, #warning, #warnings, #warnings?, #with_value

Constructor Details

This class inherits a constructor from CC::Yaml::Nodes::Node

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class CC::Yaml::Nodes::Node

Class Method Details

.default_type(identifier = nil) ⇒ Object



4
5
6
7
# File 'lib/cc/yaml/nodes/open_mapping.rb', line 4

def self.default_type(identifier = nil)
  @default_type = Nodes[identifier] if identifier
  @default_type ||= superclass.respond_to?(:default_type) ? superclass.default_type : nil
end

Instance Method Details

#accept_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/cc/yaml/nodes/open_mapping.rb', line 14

def accept_key?(key)
  true
end

#subnode_for(visitor, key, value) ⇒ Object



9
10
11
12
# File 'lib/cc/yaml/nodes/open_mapping.rb', line 9

def subnode_for(visitor, key, value)
  klass = self.class.subnode_for_key(key) || self.class.default_type || visitor.node_wrapper_class(value)
  klass.new(self)
end