Sha256: 2523bf6fa35eb34898510094fd400c0271241370187853b79c28fd5fb68f2e45

Contents?: true

Size: 484 Bytes

Versions: 2

Compression:

Stored size: 484 Bytes

Contents

require 'yaml'

module Everything
  class Piece
    class Metadata
      extend Forwardable

      def initialize(piece_path)
        @piece_path = piece_path
      end

      def file_path
        @file_path ||= File.join(piece_path, file_name)
      end

      def raw_yaml
        @raw_yaml ||= YAML.load_file(file_path)
      end

      def_delegators :raw_yaml, :[]

    private
      attr_reader :piece_path

      def file_name
        'index.yaml'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
everything-core-0.0.7 lib/everything/piece/metadata.rb
everything-core-0.0.6 lib/everything/piece/metadata.rb