Sha256: 6fa0114db1f0c2c729d3fd9bdb3be4b016a832f3a8033fe927c4ec021c495c61

Contents?: true

Size: 595 Bytes

Versions: 4

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

require "shale"

module Suma
  module SiteConfig
    class SiteInfo < Shale::Mapper
      attribute :organization, Shale::Type::String
      attribute :name, Shale::Type::String
    end

    class Sources < Shale::Mapper
      attribute :files, Shale::Type::String, collection: true
    end

    class Base < Shale::Mapper
      attribute :source, Sources
      attribute :collection, SiteInfo
    end

    class Config < Shale::Mapper
      attribute :metanorma, Base

      def self.from_file(path)
        from_yaml(File.read(path))
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
suma-0.1.4 lib/suma/site_config.rb
suma-0.1.3 lib/suma/site_config.rb
suma-0.1.2 lib/suma/site_config.rb
suma-0.1.1 lib/suma/site_config.rb