Sha256: 014f5eabf1ecb8c0ba3e8931538a217b02be3339773dbf074e2630ff97e46b20

Contents?: true

Size: 441 Bytes

Versions: 1

Compression:

Stored size: 441 Bytes

Contents

require "yaml"
require "json"
require "ostruct"

module Fontist
  class Source
    def self.all
      new.all
    end

    def all
      source_data
    end

    private

    def source_data
      @source_data ||= JSON.parse(
        yaml_data.to_json, object_class: OpenStruct
      )
    end

    def yaml_data
      YAML.load(File.open(yaml_file))
    end

    def yaml_file
      Fontist.assets_path.join("source.yml")
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fontist-0.2.0 lib/fontist/source.rb