Sha256: 5c0a472bfd92bb1534973a3e2e8f8781452b38181e879a77d37bb1d98a23d681

Contents?: true

Size: 431 Bytes

Versions: 7

Compression:

Stored size: 431 Bytes

Contents

require 'yaml'
require 'active_support/core_ext/hash/indifferent_access'

module Pears
  module Provider
    # Used for loading simple YAML file locally.
    class LocalFile < Base
      def initialize(file_path)
        yaml_data = File.read(file_path)
        @data = parse_yaml(yaml_data)
      end

      private

      def parse_yaml(yaml_data)
        YAML.load(yaml_data).with_indifferent_access
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pears-0.0.7 lib/pears/provider/local_file.rb
pears-0.0.6 lib/pears/provider/local_file.rb
pears-0.0.5 lib/pears/provider/local_file.rb
pears-0.0.4 lib/pears/provider/local_file.rb
pears-0.0.3 lib/pears/provider/local_file.rb
pears-0.0.2 lib/pears/provider/local_file.rb
pears-0.0.1 lib/pears/provider/local_file.rb