Sha256: 3759da37c5be8a8c92033b03f76e83e31cba6dfe89189ba37888d69125fbde35
Contents?: true
Size: 660 Bytes
Versions: 49
Compression:
Stored size: 660 Bytes
Contents
require "json" require "active_support/core_ext/hash/keys" module Helper class SchemaListHelper class ValidationErrorException < StandardError end def initialize( schema_name, schema_path = "api/schemas/data/orchestrate.json" ) @schema_name = schema_name.to_sym @schema_path = schema_path data = File.read File.join Dir.pwd, @schema_path schema_variations = JSON.parse(data).deep_transform_keys(&:to_sym) @schema_active = schema_variations[@schema_name] end def schema_exists? @schema_active != nil end def schema_path @schema_active[:schema_path] end end end
Version data entries
49 entries across 49 versions & 1 rubygems