module Zakuro::Japan::Parser

Parser yaml解析

Public Class Methods

run(filepath: '') click to toggle source

解析/展開する

@param [String] filepath 元号セットファイルパス

@return [Set] 元号セット情報

# File lib/zakuro/era/japan/gengou/parser.rb, line 155
def self.run(filepath: '')
  yaml = YAML.load_file(filepath)

  failed = Validator.run(yaml_hash: yaml)

  raise ArgumentError, failed.join("\n") unless failed.empty?

  parser = SetParser.new(hash: yaml)
  parser.create
end