Sha256: f8da614d26319c604afb703ce5456e3bff2f8696bcee4bc21afe3940c7b3aa59

Contents?: true

Size: 708 Bytes

Versions: 157

Compression:

Stored size: 708 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)
        node.persist_data(paths_hash.write(to_paths_hash_key, a_value).root.to_h)
      end

      private

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

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

Version data entries

157 entries across 157 versions & 3 rubygems

Version Path
eac_config-0.14.3 lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.97.2 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_config-0.14.2 lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.82.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.81.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.80.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.79.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_config-0.14.1 lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.78.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.77.1 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.77.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.76.1 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.76.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.75.2 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.75.1 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.75.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.74.1 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.74.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb
eac_config-0.14.0 lib/eac_config/yaml_file_node/entry.rb
eac_tools-0.73.0 sub/eac_config/lib/eac_config/yaml_file_node/entry.rb