Sha256: bfaa8be4a2b2ee72f2a0eb9574430523566234489056db5bb20077d47956c2af

Contents?: true

Size: 731 Bytes

Versions: 31

Compression:

Stored size: 731 Bytes

Contents

# frozen_string_literal: true

require 'eac_config/entry_path'
require 'eac_config/node_entry'
require 'eac_ruby_utils/core_ext'

module EacConfig
  class YamlFileNode
    class Entry < ::EacConfig::NodeEntry
      enable_simple_cache

      def found?
        paths_hash.key?(to_paths_hash_key)
      end

      def value
        paths_hash[to_paths_hash_key]
      end

      def value=(a_value)
        paths_hash[to_paths_hash_key] = a_value
        node.persist_data(paths_hash.root.to_h)
      end

      private

      # @return [EacConfig::PathsHash]
      def paths_hash_uncached
        ::EacConfig::PathsHash.new(node.data)
      end

      def to_paths_hash_key
        path.parts.join('.')
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 3 rubygems

Version Path
eac_config-0.5.2 lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.28.3 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.110.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.109.1 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.109.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.28.2 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.108.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.28.1 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.107.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.28.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.106.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.27.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.26.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.105.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.25.1 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.25.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.24.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_config-0.5.1 lib/eac_config/yaml_file_node/entry.rb
avm-tools-0.104.0 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb
ehbrs-tools-0.23.1 vendor/eac_config/lib/eac_config/yaml_file_node/entry.rb